Encoding method based on encoding order change and device therefor, and decoding method based on encoding order change and device therefor

ABSTRACT

Provided is a video decoding method including obtaining split information indicating whether a current block is to be split; and when the split information indicates that the current block is to be split, splitting the current block into at least two lower blocks, obtaining encoding order information indicating an encoding order of the at least two lower blocks of the current block from the bitstream, determining a decoding order of the at least two lower blocks based on the encoding order information, and decoding the at least two lower blocks according to the decoding order.

CROSS-REFERENCE TO THE RELATED APPLICATIONS

This is a continuation of U.S. application Ser. No. 16/467,411, filedJun. 6, 2019, which claims priority from International Application No.PCT/KR2017/015212, filed on Dec. 21, 2017 and U.S. ProvisionalApplication No. 62/439,178, filed on Dec. 17, 2016, respectively. Theentire disclosures of the prior applications are considered part of thedisclosure of this continuation application, and are hereby incorporatedby reference.

TECHNICAL FIELD

The present disclosure relates to a video encoding method and a videodecoding method, and more particularly, to intra and inter predictionmethods for methods and devices for determining encoding and decodingorders of an image.

BACKGROUND ART

When a video of high quality is encoded, a large amount of data isrequired. However, because a bandwidth available for transmission of thevideo data is limited, a data rate applied to transmission of the videodata may be limited. Therefore, for efficient transmission of videodata, there is a need for video data encoding and decoding methods withminimal deterioration in image quality and increased compression rates.

Video data may be compressed by removing spatial redundancies andtemporal redundancies between pixels. Because neighboring pixelsgenerally have common characteristics, encoding information of a dataunit consisting of pixels is transmitted to remove redundancies betweenthe neighboring pixels.

Pixel values of the pixels included in the data unit are not directlytransmitted but information about a method of obtaining the pixel valuesis transmitted. A prediction method, in which a pixel value that issimilar to an original value is predicted, is determined for each dataunit, and encoding information about the prediction method istransmitted from an encoder to a decoder. Because a prediction value isnot completely equal to the original value, residual data of adifference between the original value and the prediction value istransmitted from the encoder to the decoder.

When prediction is exact, a size of the encoding information forspecifying the prediction method is increased but a size of the residualdata is decreased. Therefore, the prediction method is determined, inconsideration of sizes of the encoding information and the residualdata. In particular, a data unit that is split from a picture hasvarious sizes, and in this regard, when a size of the data unit isincreased, there is an increased probability that accuracy of predictionis decreased, whereas the size of encoding information is decreased.Thus, a size of a block is determined according to characteristics of apicture.

The prediction method includes intra prediction and inter prediction.The intra prediction is a method of predicting pixels of a block frompixels adjacent to the block. The inter prediction is a method ofpredicting pixels by referring to pixels of a different picture referredto for a picture including the block. Therefore, spatial redundancy isremoved by the intra prediction, and temporal redundancy is removed bythe inter prediction.

When the number of prediction methods is increased, an amount ofencoding information for indicating the prediction method is increased.Thus, the amount of the encoding information may be decreased bypredicting, from a different block, the encoding information to beapplied to a block.

Because loss of video data is allowed to the extent that the human eyecannot recognize the loss, residual data may be lossy-compressedaccording to transformation and quantization processes, and by doing so,an amount of the residual data may be decreased.

DESCRIPTION OF EMBODIMENTS Technical Problem

Provided is a video encoding method of determining whether to split acurrent block and an encoding order of lower blocks, and determining anencoding method according to whether neighboring blocks of the currentblock have been encoded. Provided is a video decoding method ofsplitting a current block, determining an encoding order of split lowerblocks, and determining an encoding method according to whetherneighboring blocks of the current block have been encoded. In addition,a computer-readable recording medium having recorded thereon a programfor executing the video encoding method and the video decoding methodaccording to an embodiment on a computer is provided.

Solution to Problem

Provided is a video decoding method including obtaining, from abitstream, split information indicating whether a current block is to besplit; when the split information indicates that the current block isnot to be split, decoding the current block according to encodinginformation about the current block; and when the split informationindicates that the current block is to be split, splitting the currentblock into at least two lower blocks, obtaining encoding orderinformation indicating an encoding order of the at least two lowerblocks of the current block from the bitstream, determining a decodingorder of the at least two lower blocks based on the encoding orderinformation, and decoding the at least two lower blocks according to thedecoding order.

Provided is a video decoding device including a block splitterconfigured to split a current block into at least two lower blocks whensplit information indicating whether the current block is to be splitindicates that the current block is to be split; an encoding orderdeterminer configured to determine, when the current block is split intothe at least two lower blocks, a decoding order of the at least twolower blocks being based on encoding order information indicating anencoding order of the at least two lower blocks; a prediction methoddeterminer configured to determine a prediction method for the currentblock when the split information indicates that the current block is notto be split; and a decoder configured to reconstruct the current blockaccording to a result of prediction by the prediction method.

Provided is a video encoding method including splitting a current blockinto at least two lower blocks; determining, according to a result ofthe splitting of the current block, whether to split the current block,and generating split information indicating whether the current block isto be split; according to coding efficiency of the current block,determining an encoding order of the at least two lower blocks of thecurrent block, and generating encoding order information indicating theencoding order of the at least two lower blocks; and outputting abitstream including the split information and the encoding orderinformation.

Provided is a video encoding device including an encoding informationgenerator configured to split a current block into at least two lowerblocks; determine, according to a result of the splitting of the currentblock, whether to split the current block; generate split informationindicating whether the current block is to be split, according to codingefficiency of the current block; determine an encoding order of the atleast two lower blocks of the current block; and generate encoding orderinformation indicating the encoding order of the at least two lowerblocks; and an output unit configured to output a bitstream includingthe split information and the encoding order information.

Provided is a non-transitory computer-readable recording medium havingrecorded thereon a program for performing the video encoding method andthe video decoding method.

The technical problems of the present disclosure are not limited to theaforementioned technical features, and other unstated technical problemsmay be inferred from embodiments below.

Advantageous Effects of Disclosure

Whether to split a current block and an encoding order of a lower blockare determined, and a prediction method for the lower block isdetermined according to the encoding order of the lower block, so thatcoding efficiency of an image is increased.

BRIEF DESCRIPTION OF DRAWINGS

FIG. 1A illustrates a block diagram of an image encoding device based oncoding units according to a tree structure, according to an embodimentof the present disclosure.

FIG. 1B illustrates a block diagram of an image decoding device based oncoding units according to a tree structure, according to an embodiment.

FIG. 2 illustrates a process of determining at least one coding unit bysplitting a current coding unit, according to an embodiment.

FIG. 3 illustrates a process of determining at least one coding unit bysplitting a coding unit having a non-square shape, according to anembodiment.

FIG. 4 illustrates a process of splitting a coding unit based on atleast one of block shape information and split shape information,according to an embodiment.

FIG. 5 illustrates a method of determining a predetermined coding unitfrom among an odd number of coding units, according to an embodiment.

FIG. 6 illustrates an order in which a plurality of coding units areprocessed when a current coding unit is split and thus the plurality ofcoding units are determined, according to an embodiment.

FIG. 7 illustrates a process of determining a current coding unit to besplit into an odd number of coding units when coding units are unable tobe processed in a predetermined order, according to an embodiment.

FIG. 8 illustrates a process of determining at least one coding unitwhen a first coding unit is split, according to an embodiment.

FIG. 9 illustrates that, when a second coding unit having a non-squareshape, which is determined when a first coding unit is split, satisfiesa predetermined condition, a shape of the second coding unit that issplittable is limited, according to an embodiment.

FIG. 10 illustrates a process of splitting a coding unit having a squareshape when split shape information indicates that the coding unit is notto be split into four coding units having square shapes, according to anembodiment.

FIG. 11 illustrates that a processing order between a plurality ofcoding units may be changed according to a process of splitting a codingunit, according to an embodiment.

FIG. 12 illustrates a process of determining a depth of a coding unit asa shape and size of the coding unit change, when the coding unit isrecursively split and thus a plurality of coding units are determined,according to an embodiment.

FIG. 13 illustrates a depth determinable according to shapes and sizesof coding units, and a part index (PID) for distinguishing between thecoding units, according to an embodiment.

FIG. 14 illustrates that a plurality of coding units are determinedaccording to a plurality of predetermined data units included in apicture, according to an embodiment.

FIG. 15 illustrates a processing block that is a criterion indetermining a determining order of a reference coding unit included in apicture, according to an embodiment.

FIG. 16 illustrates a video decoding device involving splitting acurrent block and determining an encoding order of split lower blocks,according to an embodiment.

FIGS. 17A to 17C illustrate a default encoding order according to anembodiment.

FIGS. 18A and 18B respectively illustrate a case in which a coding unitis encoded in a forward direction and a case in which a coding unit isencoded in a backward direction.

FIG. 19 illustrates a tree structure of a largest coding unit fordescribing an encoding order of a largest coding unit and coding unitsincluded in the largest coding unit.

FIGS. 20A and 20B illustrate how an encoding order of at least threeblocks arranged in a vertical or horizontal direction is changedaccording to an encoding order flag.

FIGS. 21A and 21B illustrate a method of transforming a current blockwhen a right block, not a left block, of the current block has beendecoded prior to the current block.

FIG. 22 illustrates a method of determining a most probable mode (MPM)of a current block.

FIG. 23 is a diagram for describing smoothing with respect to referencepixels to be referred to in intra prediction with respect to a currentblock.

FIGS. 24A and 24B illustrate a method of determining a residual blockaccording to horizontal differential pulse-code modulation (DPCM).

FIG. 25 illustrates a range of neighboring samples necessary todetermine an illumination coefficient with respect to illuminationcompensation.

FIGS. 26A to 26C illustrate a method of predicting a current blockaccording to a position dependent intra prediction combination (PDPC)mode.

FIG. 27 illustrates a video decoding method according to an embodimentinvolving splitting a current block and determining an encoding order ofsplit lower blocks.

FIG. 28 illustrates a video encoding device according to an embodimentinvolving splitting a current block and determining an encoding order ofsplit lower blocks.

FIG. 29 illustrates a video encoding method according to an embodimentinvolving splitting a current block and determining an encoding order ofsplit lower blocks.

BEST MODE

Provided is a video decoding method including obtaining, from abitstream, split information indicating whether a current block is to besplit; when the split information indicates that the current block isnot to be split, decoding the current block based on encodinginformation about the current block; and when the split informationindicates that the current block is to be split, splitting the currentblock into at least two lower blocks, obtaining encoding orderinformation indicating an encoding order of the at least two lowerblocks of the current block from the bitstream, determining a decodingorder of the at least two lower blocks based on the encoding orderinformation, and decoding the at least two lower blocks according to thedecoding order.

Provided is a video decoding device including a block splitterconfigured to split a current block into at least two lower blocks whensplit information indicating whether the current block is to be splitindicates that the current block is to be split; an encoding orderdeterminer configured to determine, when the current block is split intothe at least two lower blocks, a decoding order of the at least twolower blocks based on encoding order information indicating an encodingorder of the at least two lower blocks; a prediction method determinerconfigured to determine a prediction method for the current block whenthe split information indicates that the current block is not to besplit; and a decoder configured to reconstruct the current blockaccording to a result of prediction by the prediction method.

MODE OF DISCLOSURE

Advantages and features of embodiments and methods of accomplishing thesame may be understood more readily by reference to the followingdetailed descriptions of the embodiments and the accompanying drawings.In this regard, the present disclosure may, however, be embodied in manydifferent forms and should not be construed as being limited to theembodiments set forth herein. Rather, these embodiments are provided sothat this disclosure will be thorough and complete and will fully conveythe concept of the present embodiments to one of ordinary skill in theart.

Hereinafter, the terms used in the specification will be brieflydefined, and the embodiments will be described in detail.

All terms including descriptive or technical terms which are used hereinshould be construed as having meanings that are obvious to one ofordinary skill in the art. However, the terms may have differentmeanings according to the intention of one of ordinary skill in the art,precedent cases, or the appearance of new technologies. Also, some termsmay be arbitrarily selected by the applicant, and in this case, themeaning of the selected terms will be described in detail in thedetailed descriptions of the disclosure. Thus, the terms used hereinhave to be defined based on the meaning of the terms together with thedescriptions throughout the specification.

An expression used in the singular encompasses the expression of theplural, unless it has a clearly different meaning in the context.

Throughout the specification, when a part “includes” or “comprises” anelement, unless there is a particular description contrary thereto, thepart can further include other elements, not excluding the otherelements. Also, the term “unit” used in the specification means asoftware component or hardware component such as a field-programmablegate array (FPGA) or an application-specific integrated circuit (ASIC),and performs specific functions. However, the term “unit” is not limitedto software or hardware. The “unit” may be formed so as to be in anaddressable storage medium, or may be formed so as to operate one ormore processors. Thus, for example, the term “unit” may refer tocomponents such as software components, object-oriented softwarecomponents, class components, and task components, and may includeprocesses, functions, attributes, procedures, subroutines, segments ofprogram code, drivers, firmware, micro codes, circuits, data, adatabase, data structures, tables, arrays, variables, or the like. Afunction provided by the components and “units” may be associated withthe smaller number of components and “units”, or may be divided intoadditional components and “units”

The term “current block” refers to one of a coding unit, a predictionunit, and a transform unit which are currently to be encoded or decoded.When, for convenience of description, there is a need to distinguishbetween blocks of other types such as a prediction unit, a transformunit, or the like, the terms “current coding block”, “current predictionblock”, and “current transform block” may be used. In addition, the term“lower block” refers to a data unit split from the “current block”. Theterm “upper block” refers to a data unit including the “current block”.

Hereinafter, a “sample” refers to data that is allocated to a samplinglocation of an image and is a processing target. For example, pixelvalues in an image of a spatial domain or transform coefficients on atransformation domain may be samples. A unit including at least onesample may be defined as a block.

The present disclosure will now be described more fully with referenceto the accompanying drawings for one of ordinary skill in the art to beable to perform the present disclosure without any difficulty. Inaddition, portions irrelevant to the descriptions of the presentdisclosure will be omitted in the drawings for clear descriptions of thepresent disclosure.

FIG. 1A illustrates a block diagram of an image encoding device 100based on coding units according to a tree structure, according to anembodiment of the present disclosure.

The image encoding device 100 includes a largest coding unit determiner110, a coding unit determiner 120, and an output unit 130.

The largest coding unit determiner 110 splits a picture or a sliceincluded in the picture into a plurality of largest coding units,according to a size of a largest coding unit. The largest coding unitmay be a data unit having a size of 32×32, 64×64, 128×128, 256×256, orthe like, wherein a shape of the data unit is a square having a widthand length in squares of 2. The largest coding unit determiner 110 mayprovide largest coding unit size information indicating the size of thelargest coding unit to the output unit 130. The largest coding unit sizeinformation may be included in a bitstream by the output unit 130.

The coding unit determiner 120 determines coding units by splitting thelargest coding unit. A coding unit may be determined by its largest sizeand depth. A depth may be defined as the number of times that the codingunit is spatially split from the largest coding unit. When the depth isincreased by 1, the coding unit is split into at least two coding units.Therefore, when the depth is increased, sizes of coding units accordingto depths are each decreased. Whether to split a coding unit isdetermined according to whether splitting the coding unit is efficientaccording to rate-distortion optimization. Then, split informationindicating whether the coding unit is to be split may be generated. Thesplit information may be expressed in the form of a flag.

The coding unit may be split by using various methods. For example, asquare coding unit may be split into four square coding units of whichwidth and height are half of those of the square coding unit. The squarecoding unit may be split into two rectangular coding units of whichwidth is half. The square coding unit may be split into two rectangularcoding units of which height is half. The square coding unit may besplit into three coding units in a manner that a width or height thereofis split by 1:2:1.

A rectangular coding unit of which width is twice as large as a heightmay be split into two square coding units. The rectangular coding unitof which width is twice as large as the height may be split into tworectangular coding units of which width is four times larger than aheight. The rectangular coding unit of which width is twice as large asthe height may be split into two rectangular coding units and one squarecoding unit in a manner that the width is split by 1:2:1.

Equally, a rectangular coding unit of which height is twice as large asa width may be split into two square coding units. The rectangularcoding unit of which height is twice as large as the width may be splitinto two rectangular coding units of which height is four times largerthan a width. Equally, the rectangular coding unit of which height istwice as large as the width may be split into two rectangular codingunits and one square coding unit in a manner that the height is split by1:2:1.

When the image encoding device 100 is capable of using two or more splitmethods, information about a split method that is usable to a codingunit, the split method being from among the split methods that areavailable to the image encoding device 100, may be determined for eachpicture. Therefore, only specific split methods may be used for eachpicture. When the image encoding device 100 uses only one split method,the information about a split method that is usable to a coding unit isnot separately determined.

When split information of a coding unit indicates that the coding unitis to be split, split shape information indicating a split method withrespect to the coding unit may be generated. When only one split methodis usable in a picture including the coding unit, the split shapeinformation may not be generated. When the split method is determined tobe adaptive to encoding information adjacent to the coding unit, thesplit shape information may not be generated.

The largest coding unit may be split to smallest coding units accordingto smallest coding unit size information. A depth of the largest codingunit may be defined to be an uppermost depth, and a depth of thesmallest coding units may be defined to be a lowermost depth. Therefore,a coding unit having an upper depth may include a plurality of codingunits having a lower depth.

As described above, according to a largest size of a coding unit, imagedata of a current picture is split into a largest coding unit. Thelargest coding unit may include coding units that are split according todepths. Because the largest coding unit is split according to thedepths, image data of a spatial domain included in the largest codingunit may be hierarchically split according to the depths.

A maximum depth that limits the maximum number of hierarchicallysplitting the largest coding unit or a minimum size of a coding unit maybe preset.

The coding unit determiner 120 compares coding efficiency ofhierarchically splitting a coding unit with coding efficiency of notsplitting the coding unit. Then, the coding unit determiner 120determines whether to split the coding unit according to a result of thecomparison. When the coding unit determiner 120 determines thatsplitting the coding unit is more efficient, the coding unit determiner120 hierarchically splits the coding unit. However, according to theresult of the comparison, when the coding unit determiner 120 determinesthat not splitting the coding unit is more efficient, the coding unitdeterminer 120 does not split the coding unit. Whether to split thecoding unit may be independently determined from whether a neighboringdifferent coding unit is split.

According to an embodiment, whether to split the coding unit may bedetermined from a coding unit having a large depth, during an encodingprocedure. For example, coding efficiency of a coding unit having amaximum depth is compared with coding efficiency of a coding unit havinga depth that is less than the maximum depth by 1, and it is determinedwhich one of coding units having the maximum depth and coding unitshaving the depth that is less than the maximum depth by 1 is efficientlyencoded in each area of a largest coding unit. According to a result ofthe determination, whether to split the coding units having the depththat is less than the maximum depth by 1 is determined in each area ofthe largest coding unit. Afterward, it is determined which one of codingunits having a depth that is less than the maximum depth by 2 and one ofthe coding units having the maximum depth and the coding units havingthe depth that is less than the maximum depth by 1, the one having beenselected according to the result of the determination, are furtherefficiently encoded in each area of the largest coding unit. The samedetermination process is performed on each of coding units having asmaller depth, and finally, whether to split the largest coding unit isdetermined according to which one of the largest coding unit and ahierarchical structure generated by hierarchically splitting the largestcoding unit is further efficiently encoded.

Whether to split the coding unit may be determined from a coding unithaving a small depth, during the encoding procedure. For example, codingefficiency of the largest coding unit is compared with coding efficiencyof a coding unit of which depth is greater than the largest coding unitby 1, and it is determined which one of the largest coding unit andcoding units of which depth is greater than the largest coding unit by 1is efficiently encoded. When the coding efficiency of the largest codingunit is better, the largest coding unit is not split. When codingefficiency of the coding units of which depth is greater than thelargest coding unit by 1 is better, the largest coding unit is split,and the comparison process is equally applied to split coding units.

When coding efficiency is examined from a coding unit having a largedepth, calculation is large but a tree structure having high codingefficiency is obtained. On the contrary, when the coding efficiency isexamined from a coding unit having a small depth, calculation is smallbut a tree structure having low coding efficiency is obtained.Therefore, in consideration of coding efficiency and calculation, analgorithm for obtaining a hierarchical tree structure of a largestcoding unit may be designed by using various methods.

To determine efficiency of a coding unit according to each depth, thecoding unit determiner 120 determines prediction and transformationmethods that are most efficient to the coding unit. To determine themost efficient prediction and transformation methods, the coding unitmay be split into predetermined data units. A data unit may have one ofvarious shapes according to a method of splitting the coding unit. Themethod of splitting the coding unit which is performed to determine thedata unit may be defined as a partition mode. For example, when a codingunit of 2N×2N (where N is a positive integer) is no longer split, a sizeof a prediction unit included in the coding unit is 2N×2N. When thecoding unit of 2N×2N is split, the size of the prediction unit includedin the coding unit may be 2N×N, N×2N, or N×N, according to the partitionmode. The partition mode according to the present embodiment maygenerate symmetrical data units obtained by symmetrically splitting aheight or width of the coding unit, data units obtained byasymmetrically splitting the height or width of the coding unit, such as1:n or n:1, data units obtained by diagonally splitting the coding unit,data units obtained by geometrically splitting the coding unit,partitions having arbitrary shapes, or the like.

The coding unit may be predicted and transformed based on a data unitincluded in the coding unit. However, according to the presentembodiment, a data unit for prediction and a data unit fortransformation may be separately determined. The data unit forprediction may be defined as a prediction unit, and the data unit fortransformation may be defined as a transform unit. A partition modeapplied to the prediction unit and a partition mode applied to thetransform unit may be different from each other, and prediction of theprediction unit and transformation of the transform unit may beperformed in a parallel and independent manner in the coding unit.

To determine an efficient prediction method, the coding unit may besplit into at least one prediction unit. Equally, to determine anefficient transformation method, the coding unit may be split into atleast one transform unit. The split into the prediction unit and thesplit into the transform unit may be independently performed from eachother. However, when a reconstructed sample in the coding unit is usedin intra prediction, a dependent relation is established betweenprediction units or transform units included in the coding unit, so thatthe split into the prediction unit and the transform unit may affecteach other.

The prediction unit included in the coding unit may be predicted throughintra prediction or inter prediction. The intra prediction involvespredicting prediction-unit samples by using reference samples adjacentto the prediction unit. The inter prediction involves predictingprediction-unit samples by obtaining reference samples from a referencepicture that is referred to for a current picture.

For the intra prediction, the coding unit determiner 120 may apply aplurality of intra prediction methods to the prediction unit, therebyselecting the most efficient intra prediction method. The intraprediction method includes a discrete cosine (DC) mode, a planar mode,directional modes such as a vertical mode and a horizontal mode, or thelike.

When a reconstructed sample adjacent to a coding unit is used as areference sample, the intra prediction may be performed on eachprediction unit. However, when a reconstructed sample in the coding unitis used as a reference sample, reconstruction with respect to thereference sample in the coding unit has to precede prediction withrespect to the reference sample in the coding unit, so that a predictionorder of a prediction unit may depend on a transformation order of atransform unit. Therefore, when the reconstructed sample in the codingunit is used as the reference sample, only an intra prediction methodfor transform units corresponding to the prediction unit, and actualintra prediction may be performed on each transform unit.

The coding unit determiner 120 may determine an optimal motion vectorand a reference picture, thereby selecting the most efficient interprediction method. For inter prediction, the coding unit determiner 120may determine a plurality of motion vector candidates from a coding unitthat is spatially and temporally adjacent to a current coding unit, andmay determine, from among them, the most efficient motion vector to be amotion vector. Equally, the coding unit determiner 120 may determine aplurality of reference picture candidates from the coding unit that isspatially and temporally adjacent to the current coding unit, and maydetermine the most efficient reference picture from among them.According to an embodiment, the reference picture may be determined fromreference picture lists that are predetermined with respect to a currentpicture. According to an embodiment, for accuracy of prediction, themost efficient motion vector from among the plurality of motion vectorcandidates may be determined to be a motion vector predictor, and amotion vector may be determined by compensating for the motion vectorpredictor. The inter prediction may be parallel performed on predictionunits in the coding unit.

The coding unit determiner 120 may reconstruct the coding unit byobtaining only information indicating the motion vector and thereference picture, according to a skip mode. According to the skip mode,all encoding information including a residual signal is skipped, exceptfor the information indicating the motion vector and the referencepicture. Because the residual signal is skipped, the skip mode may beused when accuracy of prediction is very high.

A partition mode to be used may be limited according to the predictionmethod for the prediction unit. For example, only partition modes for aprediction unit having a size of 2N×2N or N×N may be applied to intraprediction, whereas partition modes for a prediction unit having a sizeof 2N×2N, 2N×N, N×2N, or N×N may be applied to inter prediction. Inaddition, only a partition mode for a prediction unit having a size of2N×2N may be applied to a skip mode of the inter prediction. The imageencoding device 100 may change a partition mode for each predictionmethod, according to coding efficiency.

The image encoding device 100 may perform transformation based on acoding unit or a transform unit included in the coding unit. The imageencoding device 100 may transform residual data that is a differencevalue between an original value and a prediction value with respect topixels included in the coding unit. For example, the image encodingdevice 100 may perform lossy-compression on the residual data throughquantization and discrete cosine transform (DCT)/discrete sine transform(DST). Alternatively, the image encoding device 100 may performlossless-compression on the residual data without the quantization.

The image encoding device 100 may determine a transform unit that is themost efficient one for quantization and transformation. The transformunit in the coding unit may be recursively split into smaller sizedregions in a manner similar to that in which the coding unit is splitaccording to the tree structure, according to an embodiment, such thatresidual data in the coding unit may be split according to the transformunit having the tree structure according to transformation depths. Theimage encoding device 100 may generate transformation split informationabout splitting the coding unit and the transform unit according to thedetermined tree structure of the transform unit.

A transformation depth indicating the number of splitting times to reachthe transform unit by splitting the height and width of the coding unitmay also be set in the image encoding device 100. For example, in acurrent coding unit of 2N×2N, a transformation depth may be 0 when thesize of a transform unit is 2N×2N, may be 1 when the size of thetransform unit is N×N, and may be 2 when the size of the transform unitis N/2×N/2. That is, the transform unit according to the tree structuremay be set according to the transformation depth.

In conclusion, the coding unit determiner 120 determines a predictionmethod that is the most efficient one for a current prediction unit andis from among a plurality of intra prediction methods and interprediction methods. Then, the coding unit determiner 120 determines aprediction unit determination scheme according to coding efficiencyaccording to a prediction result. Equally, the coding unit determiner120 determines a transform unit determination scheme according to codingefficiency according to a transformation result. According to the mostefficient prediction unit and transform unit determination scheme,coding efficiency of a coding unit is finally determined. The codingunit determiner 120 finalizes a hierarchical structure of a largestcoding unit, according to coding efficiency of a coding unit accordingto each depth.

The coding unit determiner 120 may measure coding efficiency of codingunits according to depths, prediction efficiency of prediction methods,or the like by using Rate-Distortion Optimization based on Lagrangianmultipliers.

The coding unit determiner 120 may generate split information indicatingwhether a coding unit is to be split according to each depth accordingto the determined hierarchical structure of the largest coding unit.Then, the coding unit determiner 120 may generate, for split codingunits, partition mode information to be used in determining a predictionunit and transform unit split information to be used in determining atransform unit. In addition, when the coding unit may be split by usingat least two split methods, the coding unit determiner 120 may generateboth split information and split shape information that indicates asplit method. The coding unit determiner 120 may generate informationabout the prediction method and the transformation method that are usedin the prediction unit and the transform unit.

The output unit 130 may output, in a bitstream, a plurality of pieces ofinformation generated by the largest coding unit determiner 110 and thecoding unit determiner 120 according to the hierarchical structure ofthe largest coding unit.

A method of determining the coding unit, the prediction unit, and thetransform unit according to the tree structure of the largest codingunit will be described below with reference to FIGS. 3 to 12.

FIG. 1B illustrates a block diagram of an image decoding device 150based on coding units according to a tree structure, according to anembodiment.

The image decoding device 150 includes a receiver 160, an encodinginformation extractor 170, and a decoder 180.

Definitions of the terms including a coding unit, a depth, a predictionunit, a transform unit, various split information, or the like for adecoding operation performed by the image decoding device 150 are equalto those described above with reference to FIG. 1A and the imageencoding device 100. Because the image decoding device 150 is designedto reconstruct image data, various encoding methods used by the imageencoding device 100 may also be applied to the image decoding device150.

The receiver 160 receives and parses a bitstream with respect to anencoded video. The encoding information extractor 170 extracts, from theparsed bitstream, a plurality of pieces of information to be used indecoding largest coding units, and provides them to the decoder 180. Theencoding information extractor 170 may extract information about alargest size of a coding unit of a current picture from a header, asequence parameter set, or a picture parameter set of the currentpicture.

The encoding information extractor 170 extracts, from the parsedbitstream, a final depth and split information about coding unitsaccording to a tree structure according to each largest coding unit. Theextracted final depth and split information are output to the decoder180. The decoder 180 may split a largest coding unit according to theextracted final depth and split information, thereby determining a treestructure of the largest coding unit.

The split information extracted by the encoding information extractor170 is split information about the tree structure determined to cause aminimum encoding error, the determination being performed by the imageencoding device 100. Therefore, the image decoding device 150 mayreconstruct an image by decoding data according to a decoding schemethat causes the minimum encoding error.

The encoding information extractor 170 may extract split informationabout a data unit such as a prediction unit and a transform unitincluded in the coding unit. For example, the encoding informationextractor 170 may extract partition mode information about a partitionmode that is the most efficient one for the prediction unit. Theencoding information extractor 170 may extract transformation splitinformation about a tree structure that is the most efficient one forthe transform unit.

The encoding information extractor 170 may obtain information about themost efficient prediction method with respect to prediction units splitfrom the coding unit. Then, the encoding information extractor 170 mayobtain information about the most efficient transformation method withrespect to transform units split from the coding unit.

The encoding information extractor 170 extracts the information from thebitstream, according to a method of configuring the bitstream, themethod being performed by the output unit 130 of the image encodingdevice 100.

The decoder 180 may split a largest coding unit into coding units havingthe most efficient tree structure, based on the split information. Then,the decoder 180 may split the coding unit into the prediction unitsaccording to the partition mode information. The decoder 180 may splitthe coding unit into the transform units according to the transformationsplit information.

The decoder 180 may predict the prediction units according to theinformation about the prediction method. The decoder 180 may performinverse quantization and inverse transformation on residual data thatcorresponds to a difference between an original value and a predictionvalue of a pixel, according to information about a method oftransforming a transform unit. The decoder 180 may reconstruct pixels ofthe coding unit, according to a result of the prediction on theprediction units and a result of the transformation on the transformunits.

FIG. 2 illustrates a process, performed by the image decoding device150, of determining at least one coding unit by splitting a currentcoding unit, according to an embodiment.

According to an embodiment, the image decoding device 150 may determine,by using block shape information, a shape of a coding unit, and maydetermine, by using split shape information, a shape according to whichthe coding unit is to be split. That is, a method of splitting a codingunit, which is indicated by the split shape information, may bedetermined based on which block shape is indicated by the block shapeinformation used by the image decoding device 150.

According to an embodiment, the image decoding device 150 may use theblock shape information indicating that a current coding unit has asquare shape. For example, the image decoding device 150 may determinewhether to split a square coding unit or not, whether to split thesquare coding unit vertically, whether to split the square coding unithorizontally, or whether to split the square coding unit into fourcoding units, according to the split shape information. Referring toFIG. 2, when block shape information of a current coding unit 200indicates a square shape, the decoder 180 may not split a coding unit210 a having the same size as the current coding unit 200 according tosplit shape information indicating no split, or may determine codingunits 210 b, 210 c, and 210 d split based on split shape informationindicating a predetermined split method.

Referring to FIG. 2, the image decoding device 150 may determine the twocoding units 210 b obtained by splitting the current coding unit 200 ina vertical direction based on split shape information indicating splitin a vertical direction, according to an embodiment. The image decodingdevice 150 may determine the two coding units 210 c obtained bysplitting the current coding unit 200 in a horizontal direction based onsplit shape information indicating split in a horizontal direction. Theimage decoding device 150 may determine the four coding units 210 dobtained by splitting the current coding unit 200 in vertical andhorizontal directions based on split shape information indicating splitin vertical and horizontal directions. However, a split shape forsplitting a square coding unit may not be limitedly interpreted to aboveshapes, and may include various shapes indicatable by split shapeinformation. Predetermined split shapes for splitting a square codingunit will be described in detail below in various embodiments.

FIG. 3 illustrates a process, performed by the image decoding device150, of determining at least one coding unit by splitting a coding unithaving a non-square shape, according to an embodiment.

According to an embodiment, the image decoding device 150 may use blockshape information indicating that a current coding unit has a non-squareshape. The image decoding device 150 may determine whether or not tosplit the current coding unit having the non-square shape, or whether tosplit the current coding unit having the non-square shape by using apredetermined method. Referring to FIG. 3, when block shape informationof a current coding unit 300 or 350 indicates a non-square shape, theimage decoding device 150 may not split a coding unit 310 or 360 havingthe same size as the current coding unit 300 or 350 according to splitshape information indicating no split, or may determine coding units 320a, 320 b, 330 a, 330 b, 330 c, 370 a, 370 b, 380 a, 380 b, and 380 csplit according to split shape information indicating a predeterminedsplit method. A predetermined split method of splitting a non-squarecoding unit will be described in detail below in various embodiments.

According to an embodiment, the image decoding device 150 may determine,by using the split shape information, a shape of a coding unit is split,and in this case, the split shape information may indicate the number ofat least one coding unit generated when a coding unit is split.Referring to FIG. 3, when the split shape information indicates that thecurrent coding unit 300 or 350 is to be split into two coding units, theimage decoding device 150 may determine the two coding units 320 a and320 b or 370 a and 370 b, which are respectively included in the currentcoding unit 300 or 350 by splitting the current coding unit 300 or 350based on the split shape information.

According to an embodiment, when the image decoding device 150 splitsthe current coding unit 300 or 350 having the non-square shape based onthe split shape information, the image decoding device 150 may split thecurrent coding unit 300 or 350 having the non-square shape inconsideration of a location of a longer side. For example, the imagedecoding device 150 may determine a plurality of coding units bysplitting the current coding unit 300 or 350 in a direction of splittingthe longer sides of the current coding unit 300 or 350 in considerationof the shape of the current coding unit 300 or 350.

According to an embodiment, when split shape information indicates thata coding unit is to be split into an odd number of blocks, the imagedecoding device 150 may determine an odd number of coding units includedin the current coding unit 300 or 350. For example, when split shapeinformation indicates that the current coding unit 300 or 350 is to besplit into three coding units, the image decoding device 150 may splitthe current coding unit 300 or 350 into the three coding units 330 a,330 b, and 330 c or 380 a, 380 b, and 380 c. According to an embodiment,the image decoding device 150 may determine the odd number of codingunits included in the current coding unit 300 or 350, wherein sizes ofthe determined coding units may not be equal. For example, a size of thecoding unit 330 b or 380 b from among the odd number of coding units 330a, 330 b, and 330 c or 380 a, 380 b, and 380 c may be different fromsizes of the coding units 330 a and 330 c or 380 a or 380 c. That is,coding units that may be determined when the current coding unit 300 or350 is split may have different types of a size.

According to an embodiment, when split shape information indicates thata coding unit is to be split into an odd number of blocks, the imagedecoding device 150 may determine an odd number of coding units includedin the current coding unit 300 or 350 and may set a predetermined limiton at least one coding unit from among the odd number of coding unitsgenerated by splitting the current coding unit 300 or 350. Referring toFIG. 3, the image decoding device 150 may decode the coding unit 330 bor 380 b at the center of the three coding units 330 a, 330 b, and 330 cor 380 a, 380 b, and 380 c generated when the current coding unit 300 or350 is split in a different manner from the coding units 330 a and 330 cor 380 a and 380 c. For example, the image decoding device 150 may limitthe coding unit 330 b or 380 b at the center not to be further splitunlike the coding units 330 a and 330 c or 380 a and 380 c, or to besplit only a certain number of times.

FIG. 4 illustrates a process of splitting, by the image decoding device150, a coding unit based on at least one of block shape information andsplit shape information, according to an embodiment.

According to an embodiment, the image decoding device 150 may determinewhether to split a first coding unit 400 having a square shape intocoding units based on at least one of block shape information and splitshape information. According to an embodiment, when the split shapeinformation indicates a split of the first coding unit 400 in ahorizontal direction, the image decoding device 150 may determine asecond coding unit 410 by splitting the first coding unit 400 in thehorizontal direction. The terms “first coding unit”, “second codingunit”, and “third coding unit” according to an embodiment are used inthe context of splitting a coding unit. For example, a second codingunit may be determined when a first coding unit is split, and a thirdcoding unit may be determined when the second coding unit is split.Relations between the first through third coding units used hereinaftermay be understood to follow the above order characteristics.

According to an embodiment, the image decoding device 150 may determinewhether to split the determined second coding unit 410 into coding unitsbased on at least one of block shape information and split shapeinformation. Referring to FIG. 4, the image decoding device 150 maysplit the second coding unit 410, which has a non-square shapedetermined by splitting the first coding unit 400, into at least onethird coding unit, for example, third coding units 420 a, 420 b, 420 c,and 420 d, based on at least one of block shape information and splitshape information, or may not split the second coding unit 410. Theimage decoding device 150 may obtain at least one of block shapeinformation and split shape information, the image decoding device 150may split the first coding unit 400 based on at least one of the blockshape information and the split shape information to obtain a pluralityof second coding units (for example, the second coding unit 410) havingvarious shapes, and the second coding unit 410 may be split according toa manner of splitting the first coding unit 400 based on at least one ofthe block shape information and the split shape information. Accordingto an embodiment, when the first coding unit 400 is split into thesecond coding units 410 based on at least one of block shape informationand split shape information about the first coding unit 400, the secondcoding unit 410 may also be split into the third coding units, forexample, the third coding units 420 a, 420 b, and 420 c, 420 d, based onat least one of block shape information and split shape informationabout the second coding unit 410. That is, a coding unit may berecursively split based on at least one of split shape information andblock shape information related to the coding unit. A method used torecursively split a coding unit will be described below in variousembodiments.

According to an embodiment, the image decoding device 150 may determineto split each of the third coding units (for example, the third codingunits 420 a, 420 b, 420 c, and 420 d) into coding units or not to splitthe second coding unit 410 based on at least one of block shapeinformation and split shape information. The image decoding device 150may split the second coding unit 410 having a non-square shape into theodd number of third coding units 420 b, 420 c, and 420 d. The imagedecoding device 150 may set a predetermined limitation on apredetermined third coding unit from among the odd number of thirdcoding units 420 b, 420 c, and 420 d. For example, the image decodingdevice 150 may limit the coding unit 420 c located at the center fromamong the odd number of third coding units 420 b, 420 c, and 420 d to besplit no more or to be split to a settable number of times. Referring toFIG. 4, the image decoding device 150 may limit the coding unit 420 clocated at the center from among the odd number of third coding units420 b, 420 c, and 420 d included in the second coding unit 410 having anon-square shape to be split no more, to be split into a predeterminedsplit manner (for example, split only into four coding units or splitinto a shape corresponding to that into which the second coding unit 410is split), or to be split only a predetermined number of times (forexample, split only n times, wherein n>0). However, the limitations onthe coding unit 420 c located at the center are simply embodiments, andthus the present disclosure should not be construed as being limited tothe above embodiments, and it should be interpreted that the limitationsinclude various limitations of decoding the coding unit 420 c located atthe center differently from the coding units 420 b and 420 d.

According to an embodiment, the image decoding device 150 may obtain,from a predetermined location in a current coding unit, at least one ofblock shape information and split shape information used to split thecurrent coding unit.

According to an embodiment, when the current coding unit is split into apredetermined number of coding units, the image decoding device 150 mayselect one of the coding units. A method of selecting one of a pluralityof coding units may vary, and descriptions about such a method will bedescribed below in various embodiments.

According to an embodiment, the image decoding device 150 may split thecurrent coding unit into the plurality of coding units, and maydetermine the coding unit at the predetermined location.

FIG. 5 illustrates a method of determining, by the image decoding device150, a coding unit at a predetermined location from among an odd numberof coding units, according to an embodiment.

According to an embodiment, the image decoding device 150 may useinformation indicating a location of each of an odd number of codingunits so as to determine a coding unit located at the center of the oddnumber of coding units. Referring to FIG. 5, the image decoding device150 may determine an odd number of coding units 520 a, 520 b, and 520 cby splitting a current coding unit 500. The image decoding device 150may determine the coding unit 520 b at the center by using informationabout locations of the odd number of coding units 520 a, 520 b, and 520c. For example, the image decoding device 150 may determine the codingunit 520 located at the center by determining locations of the codingunits 520 a, 520 b, and 520 c based on information indicating locationsof predetermined samples included in the coding units 520 a, 520 b, and520 c. In detail, the image decoding device 150 may determine the codingunit 520 b located at the center by determining the locations of thecoding units 520 a, 520 b, and 520 c based on information indicatinglocations of upper-left samples 530 a, 530 b, and 530 c of the codingunits 520 a, 520 b, and 520 c.

According to an embodiment, the information indicating the locations ofthe upper-left samples 530 a, 530 b, and 530 c respectively included inthe coding units 520 a, 520 b, and 520 c may include information aboutlocations or coordinates in a picture of the coding units 520 a, 520 b,and 520 c. According to an embodiment, the information indicating thelocations of the upper-left samples 530 a, 530 b, and 530 c respectivelyincluded in the coding units 520 a, 520 b, and 520 c may includeinformation indicating widths or heights of the coding units 520 a, 520b, and 520 c included in the current coding unit 500, wherein the widthsor heights may correspond to information indicating differences betweencoordinates in the picture of the coding units 520 a, 520 b, and 520 c.That is, the image decoding device 150 may determine the coding unit 520b located at the center by directly using the information about thelocations or coordinates in the picture of the coding units 520 a, 520b, and 520 c, or by using the information about the widths or heights ofthe coding units, which indicate difference values between coordinates.

According to an embodiment, the information indicating the location ofthe upper-left sample 530 a of the top coding unit 520 a may indicate(xa, ya) coordinates, information indicating the location of theupper-left sample 530 b of the center coding unit 520 b may indicate(xb, yb) coordinates, and the information indicating the location of theupper-left sample 530 c of the bottom coding unit 520 c may indicate(xc, yc) coordinates. The image decoding device 150 may determine thecenter coding unit 520 b by using the coordinates of the upper-leftsamples 530 a, 530 b, and 530 c respectively included in the codingunits 520 a, 520 b, and 520 c. For example, when the coordinates of theupper-left samples 530 a, 530 b, and 530 c are aligned in an ascendingorder or descending order, the center coding unit 520 b including (xb,yb) that is coordinates of the upper-left sample 530 b may be determinedas a coding unit located at the center from among the coding units 520a, 520 b, and 520 c determined when the current coding unit 500 issplit. Here, the coordinates indicating the locations of the upper-leftsamples 530 a, 530 b, and 530 c may indicate coordinates indicatingabsolute locations in the picture, and further, may use (dxb, dyb)coordinates that are information indicating a relative location of theupper-left sample 530 b of the center coding unit 520 b and (dxc, dyc)coordinates that are information indicating a relative location of theupper-left sample 530 c of the bottom coding unit 520 c, based on thelocation of the upper-left sample 530 c of the top coding unit 520 a.Also, a method of determining a coding unit at a predetermined locationby using coordinates of a sample included in a coding unit asinformation indicating a location of the sample should not be limitedlyinterpreted to the above method, and may be interpreted to variousarithmetic methods capable of using coordinates of a sample.

According to an embodiment, the image decoding device 150 may split thecurrent coding unit 500 into the plurality of coding units 520 a, 520 b,and 520 c, and select a coding unit from among the coding units 520 a,520 b, and 520 c according to a predetermined criterion. For example,the image decoding device 150 may select the coding unit 520 b that hasa different size from among the coding units 520 a, 520 b, and 520 c.

According to an embodiment, the image decoding device 150 may determinethe width or height of each of the coding units 520 a, 520 b, and 520 cby using the (xa, ya) coordinates that are the information indicatingthe location of the upper-left sample 530 a of the top coding unit 520a, the (xb, yb) coordinates that are the information indicating thelocation of the upper-left sample 530 b of the center coding unit 520 b,and the (xc, yc) coordinates that are the information indicating thelocation of the upper-left sample 530 c of the bottom coding unit 520 c.The image decoding device 150 may determine a size of each of the codingunits 520 a, 520 b, and 520 c by using the coordinates (xa, ya), (xb,yb), and (xc, yc) indicating the locations of the coding units 520 a,520 b, and 520 c.

According to an embodiment, the image decoding device 150 may determinethe width of the top coding unit 520 a to xb-xa and the height to yb-ya.According to an embodiment, the image decoding device 150 may determinethe width of the center coding unit 520 b to xc-xb and the height toyc-yb. According to an embodiment, the image decoding device 150 maydetermine the width or height of the bottom coding unit by using thewidth or height of the current coding unit, and the width and height ofthe top coding unit 520 a and the center coding unit 520 b. The imagedecoding device 150 may determine one coding unit having a sizedifferent from other coding units based on the determined widths andheights of the coding units 520 a, 520 b, and 520 c. Referring to FIG.5, the image decoding device 150 may determine, as the coding unit atthe predetermined location, the center coding unit 520 b having a sizedifferent from sizes of the top coding unit 520 a and the bottom codingunit 520 c. However, because a process of determining, by the imagedecoding device 150, a coding unit having a size different from othercoding units is only an embodiment of determining a coding unit at apredetermined location by using sizes of coding units determined basedon sample coordinates, various processes of determining a coding unit ata predetermined location by comparing sizes of coding units determinedaccording to predetermined sample coordinates may be used.

However, a location of a sample which is considered to determine alocation of a coding unit should not be construed as being limited tothe upper-left, but may be interpreted that information about a locationof an arbitrary sample included in a coding unit is usable.

According to an embodiment, the image decoding device 150 may select acoding unit at a predetermined location from among an odd number ofcoding units that are determined when a current coding unit is split, inconsideration of a shape of the current coding unit. For example, whenthe current coding unit has a non-square shape in which a width islonger than a height, the image decoding device 150 may determine thecoding unit at the predetermined location along a horizontal direction.In other words, the image decoding device 150 may determine a codingunit from among coding units having different locations in thehorizontal direction, and may set a limitation on the coding unit. Whenthe current coding unit has the non-square shape in which the height islonger than the width, the image decoding device 150 may determine thecoding unit at the predetermined location along a vertical direction. Inother words, the image decoding device 150 may determine a coding unitfrom among coding units having different locations in the verticaldirection, and set a limitation on the coding unit.

According to an embodiment, the image decoding device 150 may useinformation indicating a location of each of an even number of codingunits so as to determine a coding unit at a predetermined location fromamong the even number of coding units. The image decoding device 150 maydetermine the even number of coding units by splitting a current codingunit, and determine the coding unit at the predetermined location byusing the information about the locations of the even number of codingunits. Detailed processes thereof may correspond to processes ofdetermining a coding unit at a predetermined location (for example, acenter location) from among an odd number of coding units, which havebeen described above with reference to FIG. 5, and thus descriptionsthereof are not provided again.

According to an embodiment, when a current coding unit having anon-square shape is split into a plurality of coding units,predetermined information about a coding unit at a predeterminedlocation may be used during a split process so as to determine thecoding unit at the predetermined location from among the plurality ofcoding units. For example, the image decoding device 150 may use atleast one of block shape information and split shape information, whichare stored in a sample included in a center coding unit during a splitprocess so as to determine a coding unit located at the center fromamong a plurality of coding units obtained by splitting a current codingunit.

Referring to FIG. 5, the image decoding device 150 may split the currentcoding unit 500 into the plurality of coding units 520 a, 520 b, and 520c based on at least one of block shape information and split shapeinformation, and determine the coding unit 520 b located at the centerfrom among the plurality of coding units 520 a, 520 b, and 520 c. Inaddition, the image decoding device 150 may determine the coding unit520 b located at the center in consideration of a location where atleast one of the block shape information and the split shape informationis obtained. That is, at least one of the block shape information andthe split shape information of the current coding unit 500 may beobtained from the sample 540 located at the center of the current codingunit 500, and when the current coding unit 500 is split into theplurality of coding units 520 a, 520 b, and 520 c based on at least oneof the block shape information and the split shape information, thecoding unit 520 b including the sample 540 may be determined as thecoding unit located at the center. However, information used todetermine a coding unit located at the center should not be construed asbeing limited to at least one of block shape information and split shapeinformation, and various types of information may be used during aprocess of determining a coding unit located at the center.

According to an embodiment, predetermined information for identifying acoding unit at a predetermined location may be obtained from apredetermined sample included in a coding unit to be determined.Referring to FIG. 5, the image decoding device 150 may use at least oneof block shape information and split shape information obtained from asample located at a predetermined location in the current coding unit500 (for example, a sample located at the center of the current codingunit 500) so as to determine a coding unit at a predetermined locationfrom among the plurality of coding units 520 a, 520 b, and 520 cdetermined when the current coding unit 500 is split (for example, acoding unit located at the center from among the plurality of codingunits). That is, the image decoding device 150 may determine the sampleat the predetermined location by referring to a block shape of thecurrent coding unit 500, and the image decoding device 150 may determineand set a predetermined limitation on the coding unit 520 b includingthe sample from which predetermined location (for example, at least oneof the block shape information and the split shape information) isobtained, from among the plurality of coding units 520 a, 520 b, and 520c determined when the current coding unit 500 is split. Referring toFIG. 5, the image decoding device 150 may determine the sample 540located at the center of the current coding unit 500, as the sample fromwhich the predetermined information is obtained, and the image decodingdevice 150 may set the predetermined location during a decoding process,on the coding unit 520 b including the sample 540. However, a locationof a sample from which predetermined information is obtained should notbe construed as being limited to the above location, and the sample maybe interpreted to samples at arbitrary locations included in the codingunit 520 determined to be limited.

According to an embodiment, a location of a sample from whichpredetermined location is obtained may be determined based on a shape ofthe current coding unit 500. According to an embodiment, block shapeinformation may be used to determine whether a shape of a current codingunit is a square or a non-square, and a location of a sample from whichpredetermined information is obtained may be determined based on theshape. For example, the image decoding device 150 may determine, as asample from which predetermined information is obtained, a samplelocated on a boundary of splitting at least one of a width and a heightof a current coding unit into halves by using at least one ofinformation about the width of the current coding unit and informationabout the height of the current coding unit. As another example, whenblock shape information about a current coding unit indicates anon-square shape, the image decoding device 150 may determine, as asample from which predetermined information is obtained, one of samplesadjacent to a boundary of splitting a longer side of the current codingunit into halves.

According to an embodiment, when a current coding unit is split into aplurality of coding units, the image decoding device 150 may use atleast one of block shape information and split shape information so asto determine a coding unit at a predetermined location from among theplurality of coding units. According to an embodiment, the imagedecoding device 150 may obtain at least one of the block shapeinformation and the split shape information from a sample at apredetermined location included in the coding unit, and the imagedecoding device 150 may split the plurality of coding units generatedwhen the current coding unit is split by using at least one of the splitshape information and the block shape information obtained from thesample at the predetermined location included in each of the pluralityof coding units. In other words, the coding unit may be recursivelysplit by using at least one of the block shape information and the splitshape information obtained from the sample at the predetermined locationin each coding unit. Because a process of recursively splitting a codingunit has been described above with reference to FIG. 4, details thereofare not provided again.

According to an embodiment, the image decoding device 150 may determineat least one coding unit by splitting a current coding unit, and maydetermine an order of decoding the at least one coding unit according toa predetermined block (for example, a current coding unit).

FIG. 6 illustrates an order of processing a plurality of coding unitswhen the image decoding device 150 determines the plurality of codingunits by splitting a current coding unit, according to an embodiment.

According to an embodiment, the image decoding device 150 may determine,according to block shape information and split shape information, secondcoding units 610 a and 610 b by splitting a first coding unit 600 in avertical direction, second coding units 630 a and 630 b by splitting thefirst coding unit 600 in a horizontal direction, or second coding units650 a, 650 b, 650 c, and 650 d by splitting the first coding unit 600 invertical and horizontal directions.

Referring to FIG. 6, the image decoding device 150 may determine anorder such that the second coding units 610 a and 610 b determined bysplitting the first coding unit 600 in the vertical direction to beprocessed in a horizontal direction 610 c. The image decoding device 150may determine a processing order of the second coding units 630 a and630 b determined by splitting the first coding unit 600 in thehorizontal direction to be in a vertical direction 630 c. The imagedecoding device 150 may determine the second coding units 650 a, 650 b,650 c, and 650 d determined by splitting the first coding unit 600 inthe vertical and horizontal directions to be processed according to apredetermined order (for example, a raster scan order or a z-scan order650 e) in which coding units in one row are processed and then codingunits in a next row are processed.

According to an embodiment, the image decoding device 150 mayrecursively split coding units. Referring to FIG. 6, the image decodingdevice 150 may determine a plurality of coding units 610 a, 610 b, 630a, 630 b, 650 a, 650 b, 650 c, and 650 d by splitting the first codingunit 600, and may recursively split each of the determined plurality ofcoding units 610 a, 610 b, 630 a, 630 b, 650 a, 650 b, 650 c, and 650 d.A method of splitting the plurality of coding units 610 a, 610 b, 630 a,630 b, 650 a, 650 b, 650 c, and 650 d may be similar to a method ofsplitting the first coding unit 600. Accordingly, the plurality ofcoding units 610 a, 610 b, 630 a, 630 b, 650 a, 650 b, 650 c, and 650 dmay each be independently split into a plurality of coding units.Referring to FIG. 6, the image decoding device 150 may determine thesecond coding units 610 a and 610 b by splitting the first coding unit600 in the vertical direction, and in addition, may determine to splitor not to split each of the second coding units 610 a and 610 bindependently.

According to an embodiment, the image decoding device 150 may split theleft second coding unit 610 a in the horizontal direction to obtainthird coding units 620 a and 620 b, and may not split the right secondcoding unit 610 b.

According to an embodiment, a processing order of coding units may bedetermined based on a process of splitting coding units. In other words,a processing order of split coding units may be determined based on aprocessing order of coding units just before being split. The imagedecoding device 150 may determine an order of processing the thirdcoding units 620 a and 620 b determined when the left second coding unit610 a is split independently from the right second coding unit 610 b.Because the third coding units 620 a and 620 b are determined when theleft second coding unit 610 a is split in the horizontal direction, thethird coding units 620 a and 620 b may be processed in a verticaldirection 620 c. Also, because the order of processing the left secondcoding unit 610 a and the right second coding unit 610 b is in thehorizontal direction 610 c, the third coding units 620 a and 620 bincluded in the left second coding unit 610 a may be processed in thevertical direction 620 c and then the right second coding unit 610 b maybe processed. Because the above descriptions are for describing aprocess of determining a processing order according to coding unitsbefore being split, the process should not be limitedly interpreted tothe above embodiments, and various methods of independently processingcoding units split and determined in various shapes according to apredetermined order may be used.

FIG. 7 illustrates a process of determining, by the image decodingdevice 150, a current coding unit to be split into an odd number ofcoding units when coding units are unable to be processed in apredetermined order, according to an embodiment.

According to an embodiment, the image decoding device 150 may determinethat the current coding unit is split into the odd number of codingunits based on obtained block shape information and split shapeinformation. Referring to FIG. 7, a first coding unit 700 having asquare shape may be split into second coding units 710 a and 710 bhaving non-square shapes, and the second coding units 710 a and 710 bmay be independently split into third coding units 720 a, 720 b, 720 c,720 d, and 720 e. According to an embodiment, the image decoding device150 may determine a plurality of the third coding units 720 a and 720 bby splitting the left coding unit 710 a from among the second codingunits in a horizontal direction, and the right coding unit 710 b may besplit into an odd number of the third coding units 720 c, 720 d, and 720e.

According to an embodiment, the image decoding device 150 may determinewhether a coding unit split into an odd number exists by determiningwhether the third coding units 720 a, 720 b, 720 c, 720 d, and 720 e areprocessable in a predetermined order. Referring to FIG. 7, the imagedecoding device 150 may determine the third coding units 720 a, 720 b,720 c, 720 d, and 720 e by recursively splitting the first coding unit700. The image decoding device 150 may determine, based on at least oneof block shape information and split shape information, whether there isa coding unit split into an odd number from among the first coding unit700, the second coding units 710 a and 710 b, and the third coding units720 a, 720 b, 720 c, 720 d, and 720 e. For example, a coding unitlocated at the right from among the second coding units 710 a and 710 bmay be split into the odd number of third coding units 720 c, 720 d, and720 e. An order of processing a plurality of coding units included inthe first coding unit 700 may be a predetermined order 730 (for example,a z-scan order), and the image decoding device 150 may determine whetherthe third coding units 720 c, 720 d, and 720 e determined when the rightsecond coding unit 710 b is split into an odd number satisfy a conditionof being processable according to the predetermined order.

According to an embodiment, the image decoding device 150 may determinewhether the third coding units 720 a, 720 b, 720 c, 720 d, and 720 eincluded in the first coding unit 700 satisfy a condition of beingprocessable according to a predetermined order, wherein the condition isrelated to whether at least one of a width and a height of the secondcoding units 710 a and 710 b is split into halves along boundaries ofthe third coding units 720 a, 720 b, 720 c, 720 d, and 720 e. Forexample, the third coding units 720 a and 720 b that are determined whenthe left second coding unit 710 a having a non-square shape is splitinto halves satisfy the condition, but the third coding units 720 c, 720d, and 720 e do not satisfy the condition because the boundaries of thethird coding units 720 c, 720 d, and 720 e that are determined when theright second coding unit 710 b is split into three coding units areunable to split a width or height of the right second coding unit 710 binto halves. Also, the image decoding device 150 may determinedisconnection of a scan order when the condition is dissatisfied, anddetermine that the right second coding unit 710 b is split into an oddnumber of coding units based on the determination result. According toan embodiment, when a coding unit is split into an odd number of codingunits, the image decoding device 150 may set a predetermined limitationon a coding unit at a predetermined location from among the codingunits, and because details about the limitation or the predeterminedlocation have been described above in various embodiments, detailsthereof are not provided again.

FIG. 8 illustrates a process of determining, by the image decodingdevice 150, at least one coding unit when a first coding unit 800 issplit, according to an embodiment. According to an embodiment, the imagedecoding device 150 may split the first coding unit 800 based on atleast one of block shape information and split shape informationobtained through the receiver 160. The first coding unit 800 having asquare shape may be split into four coding units having square shapes ornon-square shapes. For example, referring to FIG. 8, when block shapeinformation indicates that the first coding unit 800 is a square andsplit shape information indicates that the first coding unit 800 is tobe split into non-square coding units, the image decoding device 150 maysplit the first coding unit 800 into a plurality of non-square codingunits. In detail, when the split shape information indicates that thefirst coding unit 800 is to be split into a horizontal or verticaldirection to determine an odd number of coding units, the image decodingdevice 150 may split the first coding unit 800 having a square shapeinto, as the odd number of coding units, second coding units 810 a, 810b, and 810 c determined when the first coding unit 800 is split in thevertical direction, or second coding units 820 a, 820 b, and 820 cdetermined when the first coding unit 800 is split in the horizontaldirection.

According to an embodiment, the image decoding device 150 may determinewhether the second coding units 810 a, 810 b, and 810 c and 820 a, 820b, and 820 c included in the first coding unit 800 satisfy a conditionof being processable according to a predetermined order, wherein thecondition is related to whether at least one of the width and the heightof the first coding unit 800 is split into halves along the boundariesof the second coding units 810 a, 810 b, and 810 c and 820 a, 820 b, and820 c. Referring to FIG. 8, because the boundaries of the second codingunits 810 a, 810 b, and 810 c determined when the first coding unit 800having a square shape is split in the vertical direction are unable tosplit the width of the first coding unit 800 into halves, it may bedetermined that the first coding unit 800 does not satisfy the conditionof being processable according to the predetermined order. Also, becausethe boundaries of the second coding units 820 a, 820 b, and 820 cdetermined when the first coding unit 800 having a square shape is splitin the horizontal direction are unable to split the width of the firstcoding unit 800 into halves, it may be determined that the first codingunit 800 does not satisfy the condition of being processable accordingto the predetermined order. When the condition is dissatisfied, theimage decoding device 150 determines disconnection of a scan order andmay determine that the first coding unit 800 is split into an odd numberof coding units based on the determination result. According to anembodiment, when a coding unit is split into an odd number of codingunits, the image decoding device 150 may set a predetermined limitationon a coding unit at a predetermined location from among the codingunits, and because details about the limitation or the predeterminedlocation have been described above in various embodiments, detailsthereof are not provided again.

According to an embodiment, the image decoding device 150 may determinecoding units having various shapes by splitting a first coding unit.

Referring to FIG. 8, the image decoding device 150 may split the firstcoding unit 800 having a square shape and a first coding unit 830 or 850having a non-square shape into coding units having various shapes.

FIG. 9 illustrates that, when a second coding unit having a non-squareshape, which is determined when a first coding unit 900 is split,satisfies a predetermined condition, a shape of the second coding unitthat is splittable is limited by the image decoding device 150,according to an embodiment.

According to an embodiment, the image decoding device 150 may determine,based on at least one of block shape information and split shapeinformation obtained through the receiver 160, to split the first codingunit 900 having a square shape into second coding units 910 a, 910 b,920 a, and 920 b having non-square shapes. The second coding units 910a, 910 b, 920 a, and 920 b may be independently split. Accordingly, theimage decoding device 150 may determine to split or not to split thesecond coding units 910 a, 910 b, 920 a, and 920 b based on at least oneof block shape information and split shape information related to eachof the second coding units 910 a, 910 b, 920 a, and 920 b. According toan embodiment, the image decoding device 150 may determine third codingunits 912 a and 912 b by splitting the left second coding unit 910 ahaving a non-square shape and determined when the first coding unit 900is split in a vertical direction. However, when the left second codingunit 910 a is split in a horizontal direction, the image decoding device150 may limit the right second coding unit 910 b not to be split in thehorizontal direction like a direction in which the left second codingunit 910 a is split. When the right second coding unit 910 b is split inthe same direction and third coding units 914 a and 914 b aredetermined, the third coding units 912 a, 912 b, 914 a, and 914 b may bedetermined when the left second coding unit 910 a and the right secondcoding unit 910 b are independently split in the horizontal direction.However, this is the same result as the image decoding device 150splitting the first coding unit 900 into four second coding units 930 a,930 b, 930 c, and 930 d having square shapes based on at least one ofblock shape information and split shape information, and thus may beinefficient in terms of image decoding.

According to an embodiment, the image decoding device 150 may determinethird coding units 922 a, 922 b, 924 a, and 924 b by splitting thesecond coding units 920 a or 920 b having a non-square shape anddetermined when the first coding unit 900 is split in the horizontaldirection. However, when one of second coding units (for example, thetop second coding unit 920 a) is split in the vertical direction, theimage decoding device 150 may limit the other second coding unit (forexample, the bottom second coding unit 920 b) not to be split in thevertical direction like a direction in which the top second coding unit920 a is split based on the above reasons.

FIG. 10 illustrates a process of splitting, by the image decoding device150, a coding unit having a square shape when split shape informationindicates that the coding unit is not to be split into four coding unitshaving square shapes, according to an embodiment.

According to an embodiment, the image decoding device 150 may determinesecond coding units 1010 a, 1010 b, 1020 a, 1020 b, and the like bysplitting a first coding unit 1000 based on at least one of block shapeinformation and split shape information. The split shape information mayinclude information about various shapes into which a coding unit issplittable, but sometimes, the information about various shapes may notinclude information for splitting a coding unit into four square codingunits. According to such split shape information, the image decodingdevice 150 is unable to split the first coding unit 1000 having a squareshape into four square second coding units 1030 a, 1030 b, 1030 c, and1030 d. Based on the split shape information, the image decoding device150 may determine the second coding units 1010 a, 1010 b, 1020 a, 1020b, and the like having non-square shapes.

According to an embodiment, the image decoding device 150 mayindependently split the second coding units 1010 a, 1010 b, 1020 a, 1020b, and the like having non-square shapes. Each of the second codingunits 1010 a, 1010 b, 1020 a, 1020 b, and the like may be split in apredetermined order through a recursive method that may correspond to amethod of splitting the first coding unit 1000 based on at least one ofblock shape information and split shape information.

For example, the image decoding device 150 may determine third codingunits 1012 a and 1012 b having square shapes by splitting the leftsecond coding unit 1010 a in a horizontal direction and may determinethird coding units 1014 a and 1014 b having square shapes by splittingthe right second coding unit 1010 b in a horizontal direction. Inaddition, the image decoding device 150 may determine third coding units1016 a, 1016 b, 1016 c, and 1016 d having square shapes by splittingboth the left second coding unit 1010 a and the right second coding unit1010 b in the horizontal direction. In this case, coding units may bedetermined in the same manner in which the first coding unit 1000 issplit into the four square second coding units 1030 a, 1030 b, 1030 c,and 1030 d.

As another example, the image decoding device 150 may determine thirdcoding units 1022 a and 1022 b having square shapes by splitting the topsecond coding unit 1020 a in the vertical direction and determine thirdcoding units 1024 a and 1024 b having square shapes by splitting thebottom second coding unit 1020 b in the vertical direction. In addition,the image decoding device 150 may determine third coding units 1022 a,1022 b, 1024 a, and 1024 b having square shapes by splitting both thetop second coding unit 1020 a and the bottom second coding unit 1020 bin the vertical direction. In this case, coding units may be determinedin the same manner in which the first coding unit 1000 is split into thefour square second coding units 1030 a, 1030 b, 1030 c, and 1030 d.

FIG. 11 illustrates that a processing order between a plurality ofcoding units may be changed according to a process of splitting a codingunit, according to an embodiment.

According to an embodiment, the image decoding device 150 may split afirst coding unit 1100, based on block shape information and split shapeinformation. When the block shape information indicates a square shapeand the split shape information indicates that the first coding unit1100 is to be split in at least one of a horizontal direction and avertical direction, the image decoding device 150 may split the firstcoding unit 1100 to determine second coding units (for example, secondcoding units 1110 a, 1110 b, 1120 a, 1120 b, 1130 a, 1130 b, 1130 c,1130 d, and the like). Referring to FIG. 11, the second coding units1110 a, 1110 b, 1120 a, and 1120 b having non-square shapes anddetermined when the first coding unit 1100 is split only in thehorizontal or vertical direction may each be independently split basedon block shape information and split shape information about each of thesecond coding units 1110 a, 1110 b, 1120 a, and 1120 b. For example, theimage decoding device 150 may determine third coding units 1116 a, 1116b, 1116 c, and 1116 d by splitting the second coding units 1110 a and1110 b in the horizontal direction, wherein the second coding units 1110a and 1110 b are generated when the first coding unit 1100 is split inthe vertical direction, and may determine third coding units 1126 a,1126 b, 1126 c, and 1126 d by splitting the second coding units 1120 aand 1120 b in the horizontal direction, wherein the second coding units1120 a and 1120 b are generated when the first coding unit 1100 is splitin the horizontal direction. Because split processes of the secondcoding units 1110 a, 1110 b, 1120 a, and 1120 b have been described withreference to FIG. 9, details thereof are not provided again.

According to an embodiment, the image decoding device 150 may processcoding units according to a predetermined order. Because characteristicsabout processing of coding units according to a predetermined order havebeen described above with reference to FIG. 6, details thereof are notprovided again. Referring to FIG. 11, the image decoding device 150 maydetermine four square third coding units 1116 a, 1116 b, 1116 c, and1116 d or 1126 a, 1126 b, 1126 c, and 1126 d by splitting the firstcoding unit 1100 having a square shape. According to an embodiment, theimage decoding device 150 may determine a processing order of the thirdcoding units 1116 a, 1116 b, 1116 c, and 1116 d or 1126 a, 1126 b, 1126c, and 1126 d according to a shape of the first coding unit 1100 beingsplit.

According to an embodiment, the image decoding device 150 may determinethe third coding units 1116 a, 1116 b, 1116 c, and 1116 d by splittingeach of the second coding units 1110 a and 1110 b in the horizontaldirection, wherein the second coding units 1110 a and 1110 b aregenerated when the first coding unit 1100 is split in the verticaldirection, and the image decoding device 150 may process the thirdcoding units 1116 a, 1116 b, 1116 c, and 1116 d according to an order1117 of first processing the third coding units 1116 a and 1116 bincluded in the left second coding unit 1110 a in the vertical directionand then processing the third coding units 1116 c and 1116 d included inthe right second coding unit 1110 b in the vertical direction.

According to an embodiment, the image decoding device 150 may determinethe second coding units 1126 a, 1126 b, 1126 c, and 1126 d by splittingeach of the second coding units 1120 a and 1120 b in the verticaldirection, wherein the second coding units 1120 a and 1120 b aregenerated when the first coding unit 1100 is split in the horizontaldirection, and the image decoding device 150 may process the thirdcoding units 1126 a, 1126 b, 1126 c, and 1126 d according to an order offirst processing the third coding units 1126 a and 1126 b included inthe top second coding unit 1120 a in the horizontal direction and thenprocessing the third coding units 1126 c and 1126 d included in thebottom second coding unit 1120 b in the horizontal direction.

Referring to FIG. 11, the third coding units 1116 a, 1116 b, 1116 c,1116 d, 1126 a, 1126 b, 1126 c, and 1126 d having square shapes may bedetermined when each of the second coding units 1110 a, 1110 b, 1120 a,and 1120 b are split. The second coding units 1110 a and 1110 bdetermined when the first coding unit 1100 is split in the verticaldirection and the second coding units 1120 a and 1120 b determined whenthe first coding unit 1100 is split in the horizontal direction havedifferent shapes, but according to the third coding units 1116 a, 1116b, 1116 c, 1116 d, 1126 a, 1126 b, 1126 c, and 1126 d determinedthereafter, the first coding unit 1100 is split into coding units havingthe same shapes. Accordingly, even when coding units having the sameshape are determined as a result by recursively splitting coding unitsthrough different processes based on at least one of block shapeinformation and split shape information, the image decoding device 150may process, in different orders, the coding units having the sameshape.

FIG. 12 illustrates a process of determining a depth of a coding unit asa shape and size of the coding unit change, when the coding unit isrecursively split and thus a plurality of coding units are determined,according to an embodiment.

According to an embodiment, the image decoding device 150 may determinea depth of a coding unit according to a predetermined criterion. Forexample, the predetermined criterion may be a length of a longer side ofthe coding unit. When a length of a longer side of a coding unit beforebeing split is 2n times a length of a longer side of a current codingunit, wherein n>0, the image decoding device 150 may determine that adepth of the current coding unit is higher than a depth of the codingunit before being split by n. Hereinafter, a coding unit having a higherdepth will be referred to as a coding unit of a lower depth.

Referring to FIG. 12, according to an embodiment, the image decodingdevice 150 may determine a second coding unit 1202 and a third codingunit 1204 of lower depths by splitting a first coding unit 1200 having asquare shape, based on block shape information indicating a square shape(for example, block shape information may indicate ‘0: SQUARE’). When asize of the first coding unit 1200 having a square shape is 2N×2N, thesecond coding unit 1202 determined by splitting a width and a height ofthe first coding unit 1200 by ½ may have a size of N×N. In addition, thethird coding unit 1204 determined by splitting a width and a height ofthe second coding unit 1202 by ½ may have a size of N/2×N/2. In thiscase, a width and a height of the third coding unit 1204 correspond to ½times those of the first coding unit 1200. When a depth of the firstcoding unit 1200 is D, a depth of the second coding unit 1202, which is½ times the width and height of the first coding unit 1200, may be D+1,and a depth of the third coding unit 1204, which is ½ times the widthand height of the first coding unit 1200, may be D+2.

According to an embodiment, the image decoding device 150 may determinea second coding unit 1212 or 1222 and a third coding unit 1214 or 1224of lower depths by splitting a first coding unit 1210 or 1220 having anon-square shape, based on block shape information indicating anon-square shape (for example, the block shape information may indicate‘1:NS_VER’ indicating that a height is longer than a width or indicate‘2:NS_HOR’ indicating that a width is longer than a height).

The image decoding device 150 may determine second coding units (forexample, the second coding units 1202, 1212, 1222, and the like) bysplitting at least one of the width and the height of the first codingunit 1210 having a size of N×2N. In other words, the image decodingdevice 150 may determine the second coding unit 1202 having a size ofN×N or the second coding unit 1222 having a size of N×N/2 by splittingthe first coding unit 1210 in a horizontal direction, or may determinethe second coding unit 1212 having a size of N/2×N by splitting thefirst coding unit 1210 in horizontal and vertical directions.

According to an embodiment, the image decoding device 150 may determinethe second coding units (for example, the second coding units 1202,1212, 1222, and the like) by splitting at least one of the width and theheight of the first coding unit 1220 having a size of 2N×N. That is, theimage decoding device 150 may determine the second coding unit 1202having a size of N×N or the second coding unit 1212 having a size ofN/2×N by splitting the first coding unit 1220 in the vertical direction,or may determine the second coding unit 1222 having a size of N×N/2 bysplitting the first coding unit 1220 in the horizontal and verticaldirections.

According to an embodiment, the image decoding device 150 may determinethird coding units (for example, the third coding units 1204, 1214,1224, and the like) by splitting at least one of a width and a height ofthe second coding unit 1202 having a size of N×N. That is, the imagedecoding device 150 may determine the third coding unit 1204 having asize of N/2×N/2, the third coding unit 1214 having a size of N/2×N/2, orthe third coding unit 1224 having a size of N/2×N/2 by splitting thesecond coding unit 1202 in vertical and horizontal directions.

According to an embodiment, the image decoding device 150 may determinethe third coding units (for example, the third coding units 1204, 1214,1224, and the like) by splitting at least one of a width and a height ofthe second coding unit 1212 having a size of N/2×N. That is, the imagedecoding device 150 may determine the third coding unit 1204 having asize of N/2×N/2 or the third coding unit 1224 having a size of N/2×N/2by splitting the second coding unit 1212 in a horizontal direction, ordetermine the third coding unit 1214 having a size of N/2×N/2 bysplitting the second coding unit 1212 in vertical and horizontaldirections.

According to an embodiment, the image decoding device 150 may determinethe third coding units (for example, the third coding units 1204, 1214,1224, and the like) by splitting at least one of a width and a height ofthe second coding unit 1214 having a size of N×N/2. That is, the imagedecoding device 150 may determine the third coding unit 1204 having asize of N/2×N/2 or the third coding unit 1214 having a size of N/2×N/2by splitting the second coding unit 1212 in a vertical direction, ordetermine the third coding unit 1224 having a size of N/2×N/2 bysplitting the second coding unit 1212 in vertical and horizontaldirections.

According to an embodiment, the image decoding device 150 may splitcoding units having square shapes (for example, the first coding units1200, 1202, and 1204) in a horizontal or vertical direction. Forexample, the first coding unit 1200 having a size of 2N×2N may be splitin the vertical direction to determine the first coding unit 1210 havinga size of N×2N or in the horizontal direction to determine the firstcoding unit 1220 having a size of 2N×N/. According to an embodiment,when a depth is determined based on a length of a longest side of acoding unit, a depth of a coding unit determined when the first codingunit 1200, 1202, or 1204 is split in the horizontal or verticaldirection may be the same as a depth of the first coding unit 1200,1202, or 1204.

According to an embodiment, the width and height of the third codingunit 1214 or 1224 may be ½ times the first coding unit 1210 or 1220.When the depth of the first coding unit 1210 or 1220 is D, the depth ofthe second coding unit 1212 or 1214, which is ½ times the width andheight of the first coding unit 1210 or 1220, may be D+1, and the depthof the third coding unit 1214 or 1224, which is ½ times the width andheight of the first coding unit 1210 or 1220, may be D+2.

FIG. 13 illustrates a depth determinable according to shapes and sizesof coding units, and a part index (PID) for distinguishing between thecoding units, according to an embodiment.

According to an embodiment, the image decoding device 150 may determinesecond coding units having various shapes by splitting a first codingunit 1300 having a square shape. Referring to FIG. 13, the imagedecoding device 150 may determine second coding units 1302 a, 1302 b,1304 a, 1304 b, 1306 a, 1306 b, 1306 c, and 1306 d by splitting thefirst coding unit 1300 in at least one of a vertical direction and ahorizontal direction, according to split shape information. That is, theimage decoding device 150 may determine the second coding units 1302 a,1302 b, 1304 a, 1304 b, 1306 a, 1306 b, 1306 c, and 1306 d based onsplit shape information about the first coding unit 1300.

According to an embodiment, depths of the second coding units 1302 a,1302 b, 1304 a, 1304 b, 1306 a, 1306 b, 1306 c, and 1306 d determinedaccording to the split shape information about the first coding unit1300 having a square shape may be determined based on lengths of longersides. For example, because lengths of longer sides of the second codingunits 1302 a, 1302 b, 1304 a, and 1304 b having non-square shapes arethe same as a length of one side of the first coding unit 1300 having asquare shape, depths of the first coding unit 1300 and the second codingunits 1302 a, 1302 b, 1304 a, and 1304 b having non-square shapes may beD, i.e., the same. On the other hand, when the image decoding device 150splits the first coding unit 1300 into the four second coding units 1306a, 1306 b, 1306 c, and 1306 d having square shapes based on split shapeinformation, because a length of one side of each of the second codingunits 1306 a, 1306 b, 1306 c, and 1306 d having square shapes is ½ of alength of one side of the first coding unit 1300, depths of the secondcoding units 1306 a, 1306 b, 1306 c, and 1306 d may be D+1, i.e., onedepth lower than the depth D of the first coding unit 1300.

According to an embodiment, the image decoding device 150 may split afirst coding unit 1310 having a height longer than a width into aplurality of second coding units 1312 a, 1312 b, 1314 a, 1314 b, and1314 c by splitting the first coding unit 1310 in a horizontal directionaccording to split shape information. According to an embodiment, theimage decoding device 150 may split a first coding unit 1320 having awidth longer than a height into a plurality of second coding units 1322a and 1322 b, or 1324 a, 1324 b, and 1324 c by splitting the firstcoding unit 1320 in a vertical direction according to split shapeinformation.

According to an embodiment, depths of the second coding units 1312 a,1312 b, 1314 a, 1314 b, 1316 a, 1316 b, 1316 c, and 1316 d determinedaccording to the split shape information about the first coding unit1310 or 1320 having a non-square shape may be determined based onlengths of longer sides. For example, because a length of one side ofeach of the second coding units 1312 a and 1312 b having square shapesis ½ of a length of one side of the first coding unit 1310 having anon-square shape in which a height is longer than a width, the depths ofthe second coding units 1302 a, 1302 b, 1304 a, and 1304 b having squareshapes are D+1, i.e., one depth lower than the depth D of the firstcoding unit 1310 having a non-square shape.

In addition, the image decoding device 150 may split the first codingunit 1310 having a non-square shape into an odd number of the secondcoding units 1314 a, 1314 b, and 1314 c based on split shapeinformation. The odd number of second coding units 1314 a, 1314 b, and1314 c may include the second coding units 1314 a and 1314 c havingnon-square shapes and the second coding unit 1314 b having a squareshape. Here, because lengths of longer sides of the second coding units1314 a and 1314 c having non-square shapes and a length of one side ofthe second coding unit 1314 b having a square shape are ½ of a length ofone side of the first coding unit 1310, depths of the second codingunits 1314 a, 1314 b, and 1314 c may be D+1, i.e., one depth lower thanthe depth D of the first coding unit 1310. The image decoding device 150may determine depths of coding units related to the first coding unit1310 having a non-square shape in which a width is longer than a heightin the similar manner as depths of coding units related to the firstcoding unit 1310 are determined.

According to an embodiment, while determining PIDs for distinguishingbetween coding units, the image decoding device 150 may determine thePIDs based on size ratios between the coding units when an odd number ofthe coding units do not have the same size. Referring to FIG. 13, thecoding unit 1314 b located at the center of the odd number of codingunits 1314 a, 1314 b, and 1314 c has the same width as the coding units1314 a and 1314 c, but has a height twice higher than heights of thecoding units 1314 a and 1314 c. In this case, the coding unit 1314 blocated at the center may include two of each of the coding units 1314 aand 1314 c. Accordingly, when a PID of the coding unit 1314 b located atthe center according to a scan order is 1, a PID of the coding unit 1314c located in a next order may be increased by 2, i.e., 3. That is,values of PIDs may be discontinuous. According to an embodiment, theimage decoding device 150 may determine whether coding units split intoan odd number have the same size based on discontinuity of PIDs fordistinguishing between the coding units.

According to an embodiment, the image decoding device 150 may determinewhether a plurality of coding units determined when a current codingunit is split have certain split shapes based on values of PIDs fordistinguishing between the coding units. Referring to FIG. 13, the imagedecoding device 150 may determine an even number of the coding units1312 a and 1312 b or an odd number of the coding units 1314 a, 1314 b,and 1314 c by splitting the first coding unit 1310 having a rectangularshape in which a height is longer than a width. The image decodingdevice 150 may use an ID indicating each coding unit so as todistinguish between a plurality of coding units. According to anembodiment, the PID may be obtained from a sample at a predeterminedlocation (for example, an upper-left sample) of each coding unit.

According to an embodiment, the image decoding device 150 may determinea coding unit at a predetermined location from among coding unitsdetermined via split, by using PIDs for distinguishing between thecoding units. According to an embodiment, when split shape informationabout the first coding unit 1310 having a rectangular shape in which aheight is longer than a width indicates a split into three coding units,the image decoding device 150 may split the first coding unit 1310 intothe three coding units 1314 a, 1314 b, and 1314 c. The image decodingdevice 150 may allocate a PID to each of the three coding units 1314 a,1314 b, and 1314 c. The image decoding device 150 may compare PIDs ofcoding units so as to determine a center coding unit from among an oddnumber of coding units. The image decoding device 150 may determine thecoding unit 1314 b having a PID corresponding to a center value fromamong PIDs as a coding unit located at the center from among codingunits determined when the first coding unit 1310 is split, based on PIDsof the coding units. According to an embodiment, the image decodingdevice 150 may determine PIDs based on size ratios between coding unitswhen the coding units do not have the same size, while determining thePIDs for distinguishing between the coding units. Referring to FIG. 13,the coding unit 1314 b generated when the first coding unit 1310 issplit may have the same width as the coding units 1314 a and 1314 c, butmay have a height twice higher than heights of the coding units 1314 aand 1314 c. In this case, when the PID of the coding unit 1314 b locatedat the center is 1, the PID of the coding unit 1314 c located in a nextorder may be increased by 2, i.e., 3. As such, when an increase rangechanges while PIDs are uniformly increasing, the image decoding device150 may determine that a coding unit is split into a plurality of codingunits including a coding unit having a different size from other codingunits. According to an embodiment, when split shape informationindicates a split into an odd number of coding units, the image decodingdevice 150 may split a current coding unit into an odd number of codingunits in which a coding unit at a predetermined location (for example, acenter coding unit) has a different size from other coding units. Inthis case, the image decoding device 150 may determine the center codingunit having the different size by using PIDs of the coding units.However, because the PID, and a size or location of a coding unit at apredetermined location are specified to describe an embodiment, and thusthe present disclosure should not be construed as being limited thereto,and various PIDs, and various locations and sizes of a coding unit maybe used.

According to an embodiment, the image decoding device 150 may use apredetermined data unit from which a coding unit starts to berecursively split.

FIG. 14 illustrates that a plurality of coding units are determinedaccording to a plurality of predetermined data units included in apicture, according to an embodiment.

According to an embodiment, a predetermined data unit may be defined asa data unit from which a coding unit starts to be recursively split byusing at least one of block shape information and split shapeinformation. That is, the predetermined data unit may correspond to acoding unit of an uppermost depth used in a process of determining aplurality of coding units split from a current picture. Hereinafter, forconvenience of description, such a predetermined data unit is referredto as a reference data unit.

According to an embodiment, a reference data unit may indicate apredetermined size and shape. According to an embodiment, a referencecoding unit may include M×N samples. Here, M and N may be equal to eachother, and may be an integer expressed as a multiple of 2. That is, thereference data unit may indicate a square shape or a non-square shape,and may later be split into an integer number of coding units.

According to an embodiment, the image decoding device 150 may split acurrent picture into a plurality of reference data units. According toan embodiment, the image decoding device 150 may split the plurality ofreference data units obtained by splitting the current picture by usingsplit information about each of the reference data units. Splitprocesses of such reference data units may correspond to split processesusing a quad-tree structure.

According to an embodiment, the image decoding device 150 maypre-determine a smallest size available for the reference data unitincluded in the current picture. Accordingly, the image decoding device150 may determine the reference data unit having various sizes that areequal to or larger than the smallest size, and may determine at leastone coding unit based on the determined reference data unit by usingblock shape information and split shape information.

Referring to FIG. 14, the image decoding device 150 may use a referencecoding unit 1400 having a square shape, or may use a reference codingunit 1402 having a non-square shape. According to an embodiment, a shapeand size of a reference coding unit may be determined according tovarious data units (for example, a sequence, a picture, a slice, a slicesegment, and a largest coding unit) that may include at least onereference coding unit.

According to an embodiment, the receiver 160 of the image decodingdevice 150 may obtain, from a bitstream, at least one of informationabout a shape of a reference coding unit and information about a size ofthe reference coding unit, according to the various data units.Processes of determining at least one coding unit included in thereference coding unit 1400 having a square shape have been describedabove through processes of splitting the current coding unit 1000 ofFIG. 10, and processes of determining at least one coding unit includedin the reference coding unit 1402 having a non-square shape have beendescribed above through processes of splitting the current coding unit1100 of FIG. 11, and thus descriptions thereof are not provided here.

According to an embodiment, to determine a size and shape of a referencecoding unit according to some data units pre-determined based on apredetermined condition, the image decoding device 150 may use a PID forchecking the size and shape of the reference coding unit. That is, thereceiver 160 may obtain, from a bitstream, only a PID for checking asize and shape of a reference coding unit as a data unit satisfying apredetermined condition (for example, a data unit having a size equal toor smaller than a slice) from among various data units (for example, asequence, a picture, a slice, a slice segment, and a largest codingunit), according to slices, slice segments, and largest coding units.The image decoding device 150 may determine the size and shape of thereference data unit according to data units that satisfy thepredetermined condition, by using the PID. When information about ashape of a reference coding unit and information about a size of areference coding unit are obtained from a bitstream and used accordingto data units having relatively small sizes, usage efficiency of thebitstream may not be sufficient, and thus instead of directly obtainingthe information about the shape of the reference coding unit and theinformation about the size of the reference coding unit, only a PID maybe obtained and used. In this case, at least one of the size and theshape of the reference coding unit corresponding to the PID indicatingthe size and shape of the reference coding unit may be pre-determined.That is, the image decoding device 150 may select at least one of thepre-determined size and shape of the reference coding unit according tothe PID so as to determine at least one of the size and shape of thereference coding unit included in a data unit that is a criterion forobtaining the PID.

According to an embodiment, the image decoding device 150 may use atleast one reference coding unit included in one largest coding unit.That is, a largest coding unit splitting an image may include at leastone reference coding unit, and a coding unit may be determined when eachof the reference coding unit is recursively split. According to anembodiment, at least one of a width and height of the largest codingunit may be an integer times at least one of a width and height of thereference coding unit. According to an embodiment, a size of a referencecoding unit may be equal to a size of a largest coding unit, which issplit n times according to a quad-tree structure. That is, the imagedecoding device 150 may determine a reference coding unit by splitting alargest coding unit n times according to a quad-tree structure, and maysplit the reference coding unit based on at least one of block shapeinformation and split shape information according to variousembodiments.

FIG. 15 illustrates a processing block that is a criterion indetermining a determining order of a reference coding unit included in apicture 1500, according to an embodiment.

According to an embodiment, the image decoding device 150 may determineat least one processing block splitting a picture. A processing block isa data unit including at least one reference coding unit splitting animage, and the at least one reference coding unit included in theprocessing block may be determined in a certain order. That is, adetermining order of the at least one reference coding unit determinedin each processing block may correspond to one of various orders fordetermining a reference coding unit, and may vary according toprocessing blocks. A determining order of a reference coding unitdetermined per processing block may be one of various orders, such as araster scan order, a Z-scan order, an N-scan order, an up-right diagonalscan order, a horizontal scan order, and a vertical scan order, butshould not be limitedly interpreted by the scan orders.

According to an embodiment, the image decoding device 150 may determinea size of at least one processing block included in an image byobtaining information about a size of a processing block. The imagedecoding device 150 may obtain, from a bitstream, the information abouta size of a processing block to determine the size of the at least oneprocessing block included in the image. The size of the processing blockmay be a predetermined size of a data unit indicated by the informationabout the size of the processing block.

According to an embodiment, the receiver 160 of the image decodingdevice 150 may obtain, from the bitstream, the information about a sizeof a processing block according to certain data units. For example, theinformation about a size of a processing block may be obtained from thebitstream in data units of images, sequences, pictures, slices, andslice segments. That is, the receiver 160 may obtain, from thebitstream, the information about a size of a processing block accordingto such several data units, and the image decoding device 150 maydetermine the size of at least one processing block splitting thepicture by using the obtained information about a size of a processingblock, wherein the size of the processing block may be an integer timesa size of a reference coding unit.

According to an embodiment, the image decoding device 150 may determinesizes of processing blocks 1502 and 1512 included in the picture 1500.For example, the image decoding device 150 may determine a size of aprocessing block based on information about a size of a processingblock, the information obtained from a bitstream. Referring to FIG. 15,the image decoding device 150 may determine horizontal sizes of theprocessing blocks 1502 and 1512 to be four times a horizontal size of areference coding unit, and a vertical size thereof to be four times avertical size of the reference coding unit, according to an embodiment.The image decoding device 150 may determine a determining order of atleast one reference coding unit in at least one processing block.

According to an embodiment, the image decoding device 150 may determineeach of the processing blocks 1502 and 1512 included in the picture 1500based on a size of a processing block, and may determine a determiningorder of at least one reference coding unit included in each of theprocessing blocks 1502 and 1512. According to an embodiment, determiningof a reference coding unit may include determining of a size of thereference coding unit.

According to an embodiment, the image decoding device 150 may obtain,from a bitstream, information about a determining order of at least onereference coding unit included in at least one processing block, and maydetermine the determining order of the at least one reference codingunit based on the obtained information about a determining order. Theinformation about a determining order may be defined as an order ordirection of determining reference coding units in a processing block.That is, an order of determining reference coding units may beindependently determined per processing block.

According to an embodiment, the image decoding device 150 may obtain,from a bitstream, information about a determining order of a referencecoding unit according to certain data units. For example, the receiver160 may obtain, from the bitstream, the information about a determiningorder of a reference coding unit according to data units, such asimages, sequences, pictures, slices, slice segments, processing blocks,or the like. Because the information about a determining order of areference coding unit indicates a determining order of a referencecoding unit in a processing block, the information about a determiningorder may be obtained per certain data unit including an integer numberof processing blocks.

According to an embodiment, the image decoding device 150 may determineat least one reference coding unit based on the determined order.

According to an embodiment, the receiver 160 may obtain, from thebitstream, information about a determining order of a reference codingunit, as information related to the processing blocks 1502 and 1512, andthe image decoding device 150 may determine an order of determining atleast one reference coding unit included in the processing blocks 1502and 1512 and may determine at least one reference coding unit includedin the picture 1500 according to a determining order of a coding unit.Referring to FIG. 15, the image decoding device 150 may determinedetermining orders 1504 and 1514 of at least one reference coding unitrespectively related to the processing blocks 1502 and 1512. Forexample, when information about a determining order of a referencecoding unit is obtained per processing block, determining orders of areference coding unit related to the processing blocks 1502 and 1512 maybe different from each other. When the determining order 1504 related tothe processing block 1502 is a raster scan order, reference coding unitsincluded in the processing block 1502 may be determined according to theraster scan order. On the other hand, when the determining order 1514related to the processing block 1512 is an inverse order of the rasterscan order, reference coding units included in the processing block 1512may be determined in the inverse order of the raster scan order. Withreference to FIGS. 1 to 15, the method of splitting an image intolargest coding units, and splitting each largest coding unit into codingunits having a hierarchical tree structure are described above. Withreference to FIGS. 16 to 25, it will now be described how to encode ordecode the encoding units of the same depth according to which codingorder.

FIG. 16 illustrates a video decoding device 1600 involving determiningwhether to split a current block and an encoding order of split lowerblocks, according to an embodiment.

The video decoding device 1600 includes a block splitter 1610, anencoding order determiner 1620, a prediction method determiner 1630, anda block decoder 1640. In FIG. 16, the block splitter 1610, the encodingorder determiner 1620, the prediction method determiner 1630, and theblock decoder 1640 are formed as separate elements, but in anotherembodiment, the block splitter 1610, the encoding order determiner 1620,the prediction method determiner 1630, and the block decoder 1640 may beintegrated to be implemented as one element.

In FIG. 16, the block splitter 1610, the encoding order determiner 1620,the prediction method determiner 1630, and the block decoder 1640 areseen as elements located within one apparatus, but the block splitter1610, the encoding order determiner 1620, the prediction methoddeterminer 1630, and the block decoder 1640 are not required to bephysically adjacent to each other. Thus, in another embodiment, theblock splitter 1610, the encoding order determiner 1620, the predictionmethod determiner 1630, and the block decoder 1640 may be dispersed.

According to an embodiment, the block splitter 1610, the encoding orderdeterminer 1620, the prediction method determiner 1630, and the blockdecoder 1640 may be implemented by one processor. In another embodiment,the block splitter 1610, the encoding order determiner 1620, theprediction method determiner 1630, and the block decoder 1640 may beimplemented by a plurality of processors.

Functions performed by the block splitter 1610, the encoding orderdeterminer 1620, the prediction method determiner 1630, and the blockdecoder 1640 of FIG. 16 may be performed by the decoder 180 of FIG. 1B.

The block splitter 1610 may obtain split information indicating whethera current block is to be split. The split information indicates whetherthe current block is to be split into at least two smaller blocks. Whenthe split information indicates that the current block is to be split,the block splitter 1610 splits the current block into at least two lowerblocks.

The current block may be split into various shapes according to a shapeof the current block. For example, when the current block has a squareshape, the current block may be split into at least four square lowerblocks, according to the split information.

When at least two split methods are allowed for the shape of the currentblock, the block splitter 1610 may select a split method according tosplit shape information. Thus, when the split information indicates thatthe current block is to be split, the block splitter 1610 may split thecurrent block, according to the split method indicated by the splitshape information.

For example, when the current block has a square shape of 2N×2N size,the split shape information may indicate a split method from among N×Nsplit, 2N×N split, N×2N split, vertically unequal tri-split, andhorizontally unequal tri-split, the split method being applied to thecurrent block. The N×N split indicates a method of splitting the currentblock into four blocks of N×N size. The 2N×N split indicates a method ofsplitting the current block into blocks of 2N×N size. The N×2N splitindicates a method of splitting the current block into blocks of N×2Nsize. The vertically unequal tri-split indicates a method of splitting a2N×2N-size block into three blocks that have a same width and haverespective heights having a ratio 1:2:1. The horizontally unequaltri-split indicates a method of splitting a 2N×2N-size block into threeblocks that have a same height and have respective heights having aratio 1:2:1. In addition, the current block may be split according toone of various horizontal split methods or vertical split methods.

When the current block has a vertically-long rectangular shape having2N×N size, the split shape information may indicate a split method fromamong N×N split and vertically unequal tri-split, the split method beingapplied to the current block. The N×N split indicates a method ofsplitting the current block into two blocks of N×N size. The verticallyunequal tri-split indicates a method of splitting a 2N×N-size block intothree blocks that have a same width and have respective heights having aratio 1:2:1. In addition, the current block may be split according toone of various horizontal split methods or vertical split methods.

When the current block has a horizontally-long rectangular shape havingN×2N size, the split shape information may indicate a split method fromamong N×N split and horizontally unequal tri-split, the split methodbeing applied to the current block. The N×N split indicates a method ofsplitting the current block into two blocks of N×N size. Thehorizontally unequal tri-split indicates a method of splitting aN×2N-size block into three blocks that have a same height and haverespective heights having a ratio 1:2:1. In addition, the current blockmay be split according to one of various horizontal split methods orvertical split methods.

In addition to the aforementioned split methods, a method ofasymmetrically splitting a current block, a method of splitting acurrent block according to a triangular shape, a method of splitting acurrent block according to other geometric shape, or the like may beused to split a current block having a square shape and or a rectangularshape.

When the split information indicates that the current block is not to besplit, the block splitter 1610 does not split the current block. Then,the block decoder 1640 decodes the current block.

When the current block is a coding unit, the block splitter 1610determines the current block as a final coding unit. The final codingunit is not split into coding units having a deeper depth. According toan embodiment, when the current block that is the final coding unit issplit into data units other than a coding unit, the block decoder 1640may make the block splitter 1610 split the current block.

According to an embodiment, the block splitter 1610 may split thecurrent block into one or more prediction units according to ahierarchical tree structure. Equally, the block splitter 1610 may splitthe current block may split the current block into one or more transformunits according to the hierarchical tree structure. Then, the blockdecoder 1640 may reconstruct the current block according to a predictionresult with respect to the prediction units and a transformation resultwith respect to the transform units.

When the current block is a prediction unit, the block decoder 1640 mayperform prediction on the current block. When the current block is atransform unit, the block decoder 1640 may inverse quantize and inversetransform a quantized transform coefficient with respect to the currentblock, thereby obtaining residual data.

The encoding order determiner 1620 obtains encoding order informationindicating an encoding order of lower blocks. Then, the encoding orderdeterminer 1620 may determine a decoding order of the lower blocks,based on the obtained encoding order information.

The encoding order information indicates an encoding order of at leasttwo lower blocks included in the current block. A data amount of theencoding order information is determined based on the number of lowerblocks and an encoding order determining scheme.

For example, when there are two lower blocks, the encoding orderinformation may be determined to indicate a first-encoded lower blockfrom among the two lower blocks. Thus, the encoding order informationmay be in the form of a flag having a 1-bit data amount.

However, when there are four lower blocks, the number of cases of anencoding order of lower blocks is 4!=24. Therefore, to indicate 24encoding orders, a 5-bit data amount is required. That is, when thenumber of lower blocks is increased, the number of cases of an encodingorder is increased. Therefore, to decrease a data amount of the encodingorder information, an encoding order determining scheme of determiningan encoding order by determining whether encoding orders of some lowerblock pairs are swapped in a predetermined default encoding order.Encoding order information indicating whether the encoding orders ofsome lower block pairs are to be swapped indicates a forward directionor a backward direction with respect to the default encoding order.

A current picture including the current block is encoded and decodedaccording to the default encoding order. All blocks and pixels to beencoded and decoded in the current picture are to be encoded and decodedat a same level according to the default encoding order. Thus, lowerblocks at a same level split from the current block are also to beencoded and decoded according to the default encoding order. Anembodiment of the default encoding order is illustrated in FIGS. 17A to17C to be described below.

Therefore, when a lower block pair is encoded according to the defaultencoding order, it is described that the lower block pair is encoded ina forward direction. On the contrary, when the lower block pair isencoded according to an inverse order to the default encoding order, itis described that the lower block pair is encoded in a backwarddirection.

For example, in a case where two lower blocks are horizontally adjacentto each other and are encoded in a forward direction, the encoding orderinformation may be determined to allow a left lower block to be firstdecoded. On the contrary, in a case where the two lower blocks that arehorizontally adjacent to each other are encoded in a backward direction,the encoding order information may be determined to allow a right lowerblock to be first decoded.

Equally, in a case where two lower blocks are vertically adjacent toeach other and are encoded in a forward direction, the encoding orderinformation may be determined to allow an upper-lower block to be firstdecoded. On the contrary, in a case where the two lower blocks that arevertically adjacent to each other are encoded in a backward direction,the encoding order information may be determined to allow a furtherlower block to be first decoded.

When the encoding order information indicates only an encoding order ofa lower block pair, the encoding order information has a 1-bit dataamount. The encoding order information having 1-bit data amount may bedefined as an encoding order flag.

The encoding order determiner 1620 may obtain the encoding orderinformation from a bitstream. The encoding order information may bepositioned after split information in the bitstream.

The encoding order determiner 1620 may internally determine the encodingorder information according to a surrounding environment of the currentblock. The encoding order information may be determined according towhether neighboring blocks adjacent to the current block have beenencoded. For example, the encoding order determiner 1620 may determine alower block to be first decoded, the lower block having many adjacentneighboring blocks from among lower blocks.

With respect to the encoding order determiner 1620, a default encodingorder according to an embodiment will now be described with reference toFIGS. 17A to 17C. The default encoding order of FIGS. 17A to 17C is a Zencoding order. According to the Z encoding order, data units areencoded from the left to the right, and when data units of a current roware all encoded, data units included in a lower row of the current roware encoded from the left to the right. The aforementioned Z encodingorder is referred to as a raster scan order.

FIG. 17A illustrates encoding orders according to a Z encoding order oflargest coding units included in a current picture 1700. According tothe Z encoding order, indexes 0 to 15 are set to the largest codingunits. Largest coding units of a first row to which the indexes 0 to 3are set according to the Z encoding order are first encoded, and largestcoding units of a second row to which the indexes 4 to 7 are encodedfrom the left to the right. The largest coding units are internallyencoded according to the Z encoding order.

FIG. 17B illustrates an encoding order of a largest coding unit 1710having the index 6 from among the largest coding units included in thecurrent picture 1700. Coding units of a final depth for which split hasbeen completed according to the Z encoding order are set with theindexes 0 to 15. The Z encoding order is applied to data units of a samedepth. In addition, until lower coding units of a coding unit of a depthn are all encoded, the coding unit of the depth n having a secondpriority is not encoded. For example, until coding units having theindexes 5 to 14 are all encoded, a coding unit having the index 15 isnot encoded. The coding units are also internally encoded according tothe Z encoding order.

FIG. 17C illustrates a reference sample to be referred to for a codingunit 1724 having the index 6 from among the coding units included in thelargest coding unit 1710. Only a coding unit 1712 having the index 0 anda coding unit 1722 having the index 5 have been reconstructed around thecoding unit 1724 having the index 6 to be currently encoded. Therefore,for the coding unit 1724, only a pixel 1750 of the coding unit 1712 anda pixel 1760 of the coding unit 1722 may be used as a reference sample.

The Z encoding order of FIGS. 17A to 17C may be applied in anotherdirection according to a data unit. For example, the Z encoding ordermay be changed to allow data units to be encoded from the right to theleft in a same row. Also, the Z encoding order may be changed such that,after all data units of a current row are encoded, data units includedin an upper row of the current row are to be encoded. Also, the Zencoding order may be changed such that data units of a same column areencoded from the top to the bottom and, after all data units of acurrent column are encoded, data units included in a right column of thecurrent column are to be encoded.

Regarding the encoding order determiner 1620, FIGS. 18A and 18Brespectively illustrate a case 1800 in which a coding unit 1810 isencoded in a forward direction and a case 1802 in which a coding unit1820 is encoded in a backward direction. With reference to FIGS. 18A and18B, an advantage obtained by changing an encoding order will now bedescribed.

The coding units 1810 and 1820 of FIGS. 18A and 18B are predictedaccording to an intra mode in an upper-right direction. A continuousline 1830 of FIGS. 18A and 18B corresponds to pixels having a constantvalue and arranged in a straight line in an original image. Therefore,when a current coding unit is predicted in a direction of the continuousline 1830, prediction accuracy with respect to the coding units 1810 and1820 may be improved.

In the case 1800 of encoding in the forward direction, a left codingunit, an upper coding unit, and an upper-right coding unit of thecurrent coding unit 1810 are first reconstructed prior to the currentcoding unit 1810. Therefore, the current coding unit 1810 refers topixels or encoding information of the left coding unit, the upper codingunit, and the upper-right coding unit. For example, pixels 1816 locateda lower corner of the upper-right coding unit are used in predicting thecurrent coding unit 1810. Because the pixels 1816 are spatially distantfrom the current coding unit 1810, prediction accuracy with respect to aportion 1814 of the current coding unit 1810 may be low.

However, in the case 1802 of encoding in the backward direction, a rightcoding unit, an upper coding unit, and an upper-left coding unit of acurrent coding unit 1820 are first reconstructed before the currentcoding unit 1820, and thus, in intra prediction, pixels 1826 located ata left corner of the right coding unit may be used in predicting thecurrent coding unit 1820. Because the pixels 1826 are adjacent to thecurrent coding unit 1820, prediction accuracy with respect to a portion1824 of the current coding unit 1820 may be further improved than theprediction accuracy with respect to the portion 1814 of the currentcoding unit 1810.

As in an embodiment of the intra prediction described with reference toFIGS. 18A and 18B, there are many cases in which prediction accuracy ofinter prediction may be improved by obtaining encoding information froma block located in a backward direction. When a current coding unit anda right coding unit of the current coding unit are coding units withrespect to a same object, the current coding unit and motion informationof the right coding unit may be similar to each other. Therefore, codingefficiency may be increased by deriving motion information of thecurrent coding unit from the motion information of the right codingunit.

Therefore, by determining an encoding order by comparing codingefficiency of a case in which the current coding unit is encoded in aforward direction with coding efficiency of a case in which the currentcoding unit is encoded in a backward direction, coding efficiency withrespect to an image may be improved.

Encoding order information may be set to be equal to encoding orderinformation applied to an upper block of a current block. For example,when the current block is a prediction unit or a transform unit, theencoding order determiner 1620 may apply, to the current block, encodingorder information applied to a coding unit including the current block.As another example, when the current block is a coding unit, theencoding order determiner 1620 may apply, to the current block, encodingorder information applied to a coding unit whose depth is lower than thecurrent block.

When at least two encoding order flags are present with respect to thecurrent block, the encoding order determiner 1620 may obtain only oneencoding order flag from a bitstream, and may determine the otherencoding order flag to interoperate with the encoding order flagobtained from the bitstream.

With respect to encoding order determination by the encoding orderdeterminer 1620, FIG. 19 illustrates a tree structure of a largestcoding unit for describing an encoding order of the largest coding unitand coding units included in the largest coding unit.

A largest coding unit 1950 is split into a plurality of coding units1956, 1958, 1960, 1962, 1968, 1970, 1972, 1974, 1980, 1982, 1984, and1986. The largest coding unit 1950 corresponds to an uppermost node 1900of the tree structure. The plurality of coding units 1956, 1958, 1960,1962, 1968, 1970, 1972, 1974, 1980, 1982, 1984, and 1986 respectivelycorrespond to a plurality of nodes 1906, 1908, 1910, 1912, 1918, 1920,1922, 1924, 1930, 1932, 1934, and 1936. Upper encoding order flags 1902,1914, and 1926 indicating encoding orders in the tree structurecorrespond to arrows 1952, 1964, and 1976, and upper encoding orderflags 1904, 1916, and 1928 correspond to arrows 1954, 1966, and 1978.

An upper encoding order flag indicates an encoding order of two codingunits located above from among four coding units having a same depth.When the upper encoding order flag indicates 0, encoding is performed ina forward direction. On the contrary, when the upper encoding order flagindicates 1, encoding is performed in a backward direction.

Equally, a lower encoding order flag indicates an encoding order of twocoding units located in the lower side from among the four coding unitshaving the same depth. When the lower encoding order flag indicates 0,encoding is performed in a forward direction. On the contrary, when thelower encoding order flag indicates 1, encoding is performed in abackward direction.

For example, because an upper encoding order flag 1914 indicates 0, anencoding order between coding units 1968 and 1970 is determined to befrom the left that is a forward direction to the right. Also, because alower encoding order flag 1916 indicates 0, an encoding order betweencoding units 1972 and 1974 is determined to be from the right that is abackward direction to the left.

According to an embodiment, it may be set for an upper encoding orderflag and a lower encoding order flag to have a same value. For example,when the upper encoding order flag 1902 is determined to be 1, the lowerencoding order flag 1904 corresponding to the upper encoding order flag1902 may be determined to be 1. Because values of the upper encodingorder flag and the lower encoding order flag are determined to be 1 bit,information amount of encoding order information is decreased.

According to an embodiment, an upper encoding order flag and a lowerencoding order flag of a current coding unit may be determined byreferring to at least one of an upper encoding order flag and a lowerencoding order flag applied to a coding unit having a depth lower thanthe current coding unit. For example, the upper encoding order flag 1926and the lower encoding order flag 1928 applied to the coding units 1980,1982, 1984, and 1986 may be determined based on the lower encoding orderflag 1916 applied to the coding units 1972 and 1974. Therefore, theupper encoding order flag 1926 and the lower encoding order flag 1928may be determined to have a same value as the lower encoding order flag1916. Because values of the upper encoding order flag and the lowerencoding order flag are determined from an upper coding unit of thecurrent coding unit, encoding order information is not obtained from abitstream. Therefore, information amount of the encoding orderinformation is decreased.

With respect to encoding order determination by the encoding orderdeterminer 1620, how an encoding order of at least three blocks arrangedin a vertical or horizontal direction is changed according to anencoding order flag will now be described with reference to FIGS. 20Aand 20B.

An embodiment of FIG. 20A is about a method of swapping encoding orders,based on an encoding order flag, only when the encoding orders ofspatially-neighboring coding units are adjacent to each other.

A coding unit 2000 is split into three coding units 2010, 2020, and2030. When a default encoding order is from the left to the right,encoding is performed in order of the coding unit 2010, the coding unit2020, and the coding unit 2030. However, an encoding order may bechanged according to encoding order flags 2040 and 2050.

The encoding order flag 2040 indicates an encoding order of the codingunit 2010 and the coding unit 2020. When the encoding order flag 2040indicates 0, the encoding order of the coding unit 2010 and the codingunit 2020 is determined to be a forward direction. Therefore, the codingunit 2010 is encoded prior to the coding unit 2020. However, when theencoding order flag 2040 indicates 1, the encoding order of the codingunit 2010 and the coding unit 2020 is determined to be a backwarddirection, and thus the coding unit 2020 is encoded prior to the codingunit 2010.

The encoding order flag 2050 indicates an encoding order of the codingunit 2020 and the coding unit 2030. When the encoding order flag 2040indicates a forward direction, the encoding order flag 2050 is obtained.When the encoding order flag 2040 indicates a backward direction,encoding orders of the coding unit 2020 and the coding unit 2030 are notadjacent to each other, and thus the encoding order flag 2050 is notobtained. When the encoding order flag 2050 indicates 0, an encodingorder of the coding unit 2020 and the coding unit 2030 is determined tobe a forward direction. Therefore, the coding unit 2020 is encoded priorto the coding unit 2030. However, when the encoding order flag 2050indicates 1, an encoding order of the coding unit 2020 and the codingunit 2030 is determined to be a backward direction, and thus the codingunit 2030 is encoded prior to the coding unit 2020.

According to an embodiment of FIG. 20A, an encoding order of threecoding units has three cases. Therefore, to determine the encodingorder, one or two encoding order flags are used.

An embodiment of FIG. 20B is about a method of determining an encodingorder, based on an encoding order flag 2060 indicating a direction ofthe encoding order to be applied to three coding units.

The encoding order flag 2060 indicates whether an encoding order is aforward direction or a backward direction. For example, when theencoding order flag 2060 indicates 0, an encoding order of the codingunits 2010, 2020, and 2030 may be determined to be the forwarddirection. Therefore, when the encoding order flag 2060 indicates 0,encoding may be performed in order of the coding unit 2010, the codingunit 2020, and the coding unit 2030.

On the other hand, when the encoding order flag 2060 indicates 1, theencoding order of the coding units 2010, 2020, and 2030 may bedetermined to be the backward direction. Therefore, when the encodingorder flag 2060 indicates 1, encoding may be performed in order of thecoding unit 2030, the coding unit 2020, and the coding unit 2010.

Referring to the embodiment of FIG. 20B, the encoding order of threecoding units has two cases. Therefore, to determine the encoding order,one encoding order flag is used.

The methods of determining an encoding order which are used in theembodiments of FIGS. 20A and 20B may be applied to at least four codingunits.

The encoding order determiner 1620 may check encoding order changeallowance information with respect to an upper data unit of a currentblock. The encoding order change allowance information indicates whethera change in an encoding order is allowable for blocks included in theupper data unit of the current block. When the encoding order changeallowance information indicates that the change in the encoding order isnot allowable, all blocks of the upper data unit are decoded accordingto a default encoding order. When the encoding order change allowanceinformation indicates that encoding order information with respect tothe current block has been encoded, the encoding order determiner 1620may obtain the encoding order information.

The encoding order change allowance information may be included in avideo parameter set, a sequence parameter set, a picture parameter set,a slice segment header, a header of a largest coding unit, or the like.When at least two types of the encoding order information are present,two pieces of encoding order change allowance information about at leasttwo types of the encoding order information may be separately stored indifferent headers.

The encoding order change allowance information may indicate a depth atwhich encoding order information is provided, or a block size. Forexample, only when a depth of the current block is included in the depthindicated by the encoding order change allowance information, theencoding order determiner 1620 may obtain the encoding orderinformation. As another example, only when a size of the current blockcorresponds to the block size indicated by the encoding order changeallowance information, the encoding order determiner 1620 may obtain theencoding order information.

When split information indicates that the current block is not to besplit, the prediction method determiner 1630 may determine a predictionmethod with respect to the current block according to encodinginformation of the current block and whether neighboring blocks of thecurrent block have been decoded.

The encoding information of the current block may indicate how thecurrent block is to be predicted. In detail, the encoding informationmay indicate a prediction method from among a plurality of intraprediction modes and inter prediction modes. The intra prediction modesthat are applicable to the current block may include a directional mode,a DC mode, a planar mode, a multi-parameter intra (MPI) prediction mode,a linear-model (LM) chroma mode, a most probable chroma (MPC) mode, orthe like. The inter prediction modes that are applicable to the currentblock may include a merge mode, an advanced motion vector prediction(AMVP) mode, an inter skip mode, an overlapped block motion compensation(OBMC) mode, a sub-block motion vector prediction (MVP) mode, an affinemotion compensation (MC) mode, a frame rate up conversion (FRUC) mode,or the like. Therefore, the prediction method determiner 1630 maydetermine a prediction mode to be applied to the current block, based onthe encoding information of the current block.

Whether the neighboring blocks of the current block have been decoded, areference block and a reference sample to be referred to in predictingthe current block may be determined. Referring to the raster scandescribed with reference to FIGS. 17A to 17C, only left, upper,upper-left, upper-right, and lower-left blocks in the current block mayhave been decoded prior to the current block. However, when an encodingtree block including the current block has been decoded by the encodingorder determiner 1620 according to an encoding order different from theraster scan, a right block and a lower-right block of the current blockmay have been decoded prior to the current block. Therefore, theprediction method determiner 1630 may determine the reference block andthe reference sample to be referred to in predicting the current block,according to whether the left, upper, upper-left, upper-right,lower-left, right, and lower-right blocks of the current block have beendecoded.

When the current block is intra predicted, the prediction methoddeterminer 1630 may determine reference samples to be referred to forthe current block, according to whether the neighboring blocks of thecurrent block have been decoded. In an intra prediction mode, predictionvalues of samples of the current block are determined by referring tosample values of samples adjacent to the current block. Therefore, onlya neighboring block from among neighboring blocks of the current blockmay be used in predicting the current block, wherein the neighboringblock has been decoded prior to the current block and may be referred tofor the current block.

For example, when blocks are encoded according to a forward direction ofthe raster scan described with reference to FIGS. 17A to 17C, referencesamples of the upper block, the left block, the upper-left block, thelower-left block, and the upper-right block of the current block may beused in predicting the current sample. On the contrary, when the blocksare encoded according to a backward direction to the raster scan,reference samples of the upper block, the right block, the upper-rightblock, the lower-right block, and the upper-left block of the currentblock may be used in predicting the current sample.

FIGS. 21A and 21B illustrate a method of transforming a current blockwhen not a left block but a right block of the current block has beendecoded prior to the current block.

When the current block that is a coding block is intra predicted basedon right reference samples of the current block, at least one transformblock corresponding to the current block is laterally reversed. Thelaterally reversed at least one transform block is used inreconstructing the current block.

In FIG. 21A, the current block is intra predicted based on a rightneighboring sample and an upper neighboring sample. In addition, a sizeof a transform block 2100 with respect to the current block is equal toa size of the current block. Locations of residual samples included inthe transform block 2100 are laterally reversed. For example, a residualsample 2102 located in an upper-left corner of the transform block 2100is swapped with a residual sample 2116 located in an upper-right cornerof the transform block 2100. Other residual samples 2104, 2106, and 2108located in the left of a first row of the transform block 2100 arerespectively swapped with other residual samples 2114, 2112, and 2110located in the right of the first row of the transform block 2100. Withrespect to residual samples of remaining rows of the transform block2100, a residual sample in the left is swapped with a residual sample inthe right in a same manner as the first row.

In FIG. 21B, equally as in FIG. 21A, a current block is intra predictedbased on a right neighboring sample and an upper neighboring sample.However, the current block is split into four transform blocks. Residualsamples of each transform block included in the current block arelaterally reversed in a same manner to residual samples of the transformblock 2100 of FIG. 21A. For example, a residual sample 2152 located inan upper-left corner of a transform block 2150 is swapped with aresidual sample 2158 located in an upper-right corner of the transformblock 2150. A residual sample 2154 of the transform block 2150 isswapped with a residual sample 2156 of the transform block 2150. Withrespect to residual samples of remaining rows of the transform block2150, a residual sample in the left is swapped with a residual sample inthe right in a same manner as the first row. Also, residual samples ofother transform blocks 2160, 2170, and 2180 of the current block arelaterally reversed in a same manner to residual samples of the transformblock 2150.

Hereinafter, an algorithm for a lateral reversal of a transform blockwill now be described. In the algorithm below, TU_Height and TU_Widthrespectively refer to a height and width of a transform block. ‘block’refers to an original transform block, and ResidueBlock refers to alaterally-reversed transform block.

  for (Int y = 0; y < TU_Height, y++){ for (Int x = 0; x < TU_Width,x++){ ResidueBlock [y][x] = block[y][TU_Width-1-x]; }}

According to Equation “ResidueBlock [y][x]=block[y][TU_Width-1-x]”, itis apparent that a transform block is laterally-reversed. A lateralreversal of a transform block may be performed regardless of a size andshape of the transform block.

FIG. 22 illustrates a method of determining a most probable mode (MPM)of a current block, when a right block and a lower-right block of thecurrent block have been decoded prior to the current block. The MPMrefers to an intra prediction mode having a high probability to beapplied to the current block.

Referring to FIG. 22, neighboring blocks 2202, 2204, 2206, 2208, 2210,2212, and 2214 of a current block 2200 are present adjacent to thecurrent block 2200. When the current block 2200 is to be intrapredicted, intra prediction modes of the neighboring blocks 2202, 2204,2206, 2208, 2210, 2212, and 2214 of the current block 2200 are scannedto determine an MPM of the current block 2200. Also, a planar mode, adiscrete cosine (DC) mode, a vertical mode, a horizontal mode, adiagonal mode, or the like may be used as a default mode with respect todetermining the MPM. Then, an intra prediction mode of the current block2200 is determined according to the MPM of the current block 2200 andintra prediction information obtained from a bitstream.

The neighboring blocks 2202, 2204, 2206, 2208, 2210, 2212, and 2214 ofthe current block 2200 may be scanned according to a set order. Whensome of the neighboring blocks 2202, 2204, 2206, 2208, 2210, 2212, and2214 have not been decoded or have not been intra predicted, the intraprediction mode is not scanned. Therefore, neighboring blocks whoseintra prediction modes cannot be scanned are not used in determining anMPM of a current block.

According to an embodiment, neighboring blocks to be scanned may belimited. For example, intra prediction modes of only the left block2204, the upper block 2208, and the right block 2212 of the currentblock 2200 may be scanned to determine the MPM. According to anembodiment, intra prediction modes of the lower-left block 2202, theupper-left block 2206, the upper-right block 2210, and the lower-leftblock 2202 may be selectively used in determining the MPM.

An order of scanning neighboring blocks may be adaptively changedaccording to a decoding order of the current block 2200. For example,when the right block 2212 of the current block 2200 has been decodedprior to the current block 2200, an intra prediction mode of the rightblock 2212 may be scanned prior to an intra prediction mode of the leftblock 2204. On the other hand, when the right block 2212 of the currentblock 2200 has not been decoded prior to the current block 2200, theintra prediction mode of the left block 2204 may be scanned prior to theintra prediction mode of the right block 2212. In conclusion, when theright block 2212 of the current block 2200 has been decoded prior to thecurrent block 2200, it is highly probable that the intra prediction modeof the right block 2212 may be used in determining the MPM.

FIG. 23 is a diagram for describing smoothing with respect to referencepixels to be referred to in intra prediction with respect to a currentblock.

When a current block 2300 is intra predicted, reference pixels adjacentto the current block 2300 are obtained. The obtained reference pixelsare smoothed according to variation between the reference pixels.According to the variation between the reference pixels, a strongsmoothing filter or a weak smoothing filter may be used. According to anembodiment, for smoothing with respect to a reference pixel, one of atleast three smoothing filters may be used according to the variationbetween the reference pixels.

Factors described below indicate variation between reference pixels.

BilinearLeft=abs (TL+BL−2*L)<threshold

BilinearHalfLeft=abs (TL+L−2*ML)<threshold

BilinearAboveCenter=abs (TL+TR−2*MA)<threshold

BilinearAboveRight=abs (TL+AR−2*T)<threshold

BilinearAboveLeft=abs (AL+TR−2*TL)<threshold

BilinearRight=abs (TR+BR−2*R)<threshold

BilinearHalfRight=abs (TR+R−2*MR)<threshold

BilinearLeft indicates variation of left and lower-left referencesamples of a current block. BilinearLeft is determined to be 0 when avalue (abs (TL+BL−2*L)) calculated from samples 2302, 2306, and 2308 isless than a threshold value. On the other hand, BilinearLeft isdetermined to be 1 when the value (abs (TL+BL−2*L)) calculated from thesamples 2302, 2306, and 2308 is greater than the threshold value.

BilinearHalfLeft indicates variation of left reference samples of thecurrent block. BilinearHalfLeft is determined to be 0 when a value (abs(TL+L−2*ML)) calculated from samples 2302, 2304, and 2306 is less than athreshold value. On the other hand, BilinearHalfLeft is determined to be1 when the value (abs (TL+L−2*ML)) calculated from the samples 2302,2304, and 2306 is greater than the threshold value.

BilinearAboveCenter indicates variation of the left reference samples ofthe current block. BilinearAboveCenter is determined to be 0 when avalue (abs (TL+TR−2*MA)) calculated from samples 2302, 2312, and 2314 isless than a threshold value. On the other hand, BilinearAboveCenter isdetermined to be 1 when the value (abs (TL+TR−2*MA)) calculated from thesamples 2302, 2312, and 2314 is greater than the threshold value.

BilinearAboveRight indicates variation of the left reference samples ofthe current block. BilinearAboveRight is determined to be 0 when a value(abs (TL+AR−2*T)) calculated from samples 2302, 2314, and 2318 is lessthan a threshold value. On the other hand, BilinearAboveRight isdetermined to be 1 when the value (abs (TL+AR−2*T)) calculated from thesamples 2302, 2314, and 2318 is greater than the threshold value.

BilinearAboveLeft indicates variation of the left reference samples ofthe current block. BilinearAboveLeft is determined to be 0 when a value(abs (TL+TR−2*MA)) calculated from samples 2302, 2310, and 2316 is lessthan a threshold value. On the other hand, BilinearAboveLeft isdetermined to be 1 when the value (abs (TL+TR−2*MA)) calculated from thesamples 2302, 2310, and 2316 is greater than the threshold value.

BilinearRight indicates variation of the right reference samples of thecurrent block. BilinearRight is determined to be 0 when a value (abs(AL+TR−2*TL)) calculated from samples 2316, 2322, and 2324 is less thana threshold value. On the other hand, BilinearRight is determined to be1 when the value (abs (AL+TR−2*TL)) calculated from the samples 2316,2322, and 2324 is greater than the threshold value.

BilinearHalfRight indicates variation of the right reference samples ofthe current block. BilinearHalfRight is determined to be 0 when a value(abs (TR+R−2*MR)) calculated from samples 2316, 2320, and 2322 is lessthan a threshold value. On the other hand, BilinearHalfRight isdetermined to be 1 when the value (abs (TR+R−2*MR)) calculated from thesamples 2316, 2320, and 2322 is greater than the threshold value.

The threshold value may be randomly determined according to a determinedsize and intra prediction mode of the current block.

A method of determining whether to apply a strong filter to referencesample filtering according to the variation between the referencesamples will now be described based on logical expression below.

1. If Left_available && Right_available{

-   -   If BilinearHalfLeft && BilinearAboveCenter &&        BilinearHalfRight→Strongfilter=true}

2. If Left_available && !Right_available{

-   -   If BilinearLeft && BilinearAboveRight→Strongfilter=true}

3. If !Left_available && Right_available{

-   -   If BilinearRight && BilinearAboveLeft→Strongfilter=true}

4. If !Left_available && !Right_available→According to weighteddifference among AL,TL,MA,T,TR,AR, decide Strongfilter

When both a left block and a right block of the current block 2300 havebeen decoded, whether to apply the strong filter is determined based onBilinearHalfLeft, BilinearAboveCenter, and BilinearHalfRight. When allof BilinearHalfLeft, BilinearAboveCenter, and BilinearHalfRightrk are 1,reference pixels to be used in prediction with respect to the currentblock 2300 are smoothed by the strong filter.

When only the left block of the current block 2300 has been decoded,whether to apply the strong filter is determined based on BilinearLeftand BilinearAboveRight. When both BilinearLeft and BilinearAboveRightare 1, reference pixels to be used in prediction with respect to thecurrent block 2300 are smoothed by the strong filter.

When only the right block of the current block 2300 has been decoded,whether to apply the strong filter is determined based on BilinearRightand BilinearAboveLeft. When both BilinearRight and BilinearAboveLeft are1, reference pixels to be used in prediction with respect to the currentblock 2300 are smoothed by the strong filter.

When both the left block and the right block of the current block 2300have not been decoded, whether to apply the strong filter is determinedbased on a difference between weights of the samples 2302, 2310, 2312,2314, 2316, and 2318 located in a row adjacent to the current block2300. For example, when the difference between the weights is greaterthan a threshold value, the strong filter may be applied.

When the strong filter is applied to filtering with respect to areference pixel, filtering by a linear interpolation filter is performedon left reference samples, right reference samples, and upper referencesamples of the current block 2300. For example, when both the left blockand the right block of the current block 2300 have been decoded, a leftsample between the sample 2302 and the sample 2306, an upper samplebetween the sample 2302 and the sample 2316, and a right sample betweenthe sample 2316 and the sample 2322 is used as a reference sample of thecurrent block 2300. Thus, the left sample is filtered based on a resultof linear interpolation with respect to the sample 2302 and the sample2306, the upper sample is filtered based on a result of linearinterpolation with respect to the sample 2302 and the sample 2316, andthe right sample is filtered based on a result of linear interpolationwith respect to the sample 2316 and the sample 2322.

When only the left block of the current block 2300 has been decoded, aleft sample between the sample 2302 and the sample 2308, and an uppersample between the sample 2302 and the sample 2318 are used as referencesamples of the current block 2300. Thus, the left sample is filteredbased on a result of linear interpolation with respect to the sample2302 and the sample 2308, and the upper sample is filtered based on aresult of linear interpolation with respect to the sample 2302 and thesample 2318.

When only the right block of the current block 2300 has been decoded, anupper sample between the sample 2310 and the sample 2316, and a rightsample between the sample 2316 and the sample 2324 are used as referencesamples of the current block 2300. Thus, the right sample is filteredbased on a result of linear interpolation with respect to the sample2316 and the sample 2324, and the upper sample is filtered based on aresult of linear interpolation with respect to the sample 2310 and thesample 2316.

When both the left block and the right block of the current block 2300have not been decoded, only an upper sample between the sample 2310 andthe sample 2318 is a target to be reference sample filtered. Thus, theupper sample is filtered based on a result of linear interpolation withrespect to the sample 2310 and the sample 2318.

When the strong filter is not used in smoothing of a reference sample, aweak filter is applied thereto. When the weak filter is applied tosmoothing of a reference sample, a 3-tap filter whose filtercoefficients are [1,2,1] is applied to left reference samples, rightreference samples, and upper reference samples of the current block2300.

Equation 1 below indicates a method of applying the 3-tap filter. X1indicates a value of a sample to be filtered, and X1′ indicates a valueof a sample that is filtered. X0 and X2 indicate values of samplesdirectly adjacent to both sides of the sample to be filtered. Accordingto Equation 1, samples to be referred to for a current block arefiltered.

X1′=(X0+2X1+X2)/4  [Equation 1]

For example, when the sample 2326 is filtered by using the 3-tap filter,a sample value generated by applying the 3-tap filter to a value of thesample 2326 and values of neighboring samples 2325 and 2327 beingdirectly adjacent thereto is determined to be a filtered value of thesample 2326.

According to an embodiment, when the weak filter is applied to smoothingof a reference sample, a 5-tap filter whose filter coefficients are[2,3,6,3,2] may be applied to reference samples, instead of the 3-tapfilter. Alternatively, a filter to be used as the weak filter may be setto be selected from the 3-tap filter and the 5-tap filter.

Equation 2 below indicates a method of applying the 5-tap filter. X2indicates a value of a sample to be filtered, and X2′ indicates a valueof a sample that is filtered. X0, X1, X3, X4 indicate values of samplesadjacent to the sample to be filtered within a 2-pixel distance.According to Equation 2, samples to be referred to for a current blockare filtered.

X2′=(2X0+3X1+6X2+3X3+2X4)/16  [Equation 2]

For example, when the sample 2326 is filtered by using the 5-tap filter,a sample value generated by applying the 5-tap filter to a value of thesample 2326 and values of neighboring samples 2316, 2325, 2327, and 2320within a 2-pixel distance is determined to be a filtered value of thesample 2326.

Filter coefficients of the 3-tap filter and the 5-tap filter may berandomly changed by one of ordinary skill in the art.

FIGS. 24A and 24B illustrate a method of determining a residual blockaccording to horizontal differential pulse-code modulation (DPCM). DPCMis one of data conversion methods, and in which samples are converted byusing a difference between values of neighboring samples. In videoencoding and decoding, a compression method of a residual blockaccording to frequency-time domain transform and quantization is widelyused. However, when sample values of samples of the residual block areuniform, compression efficiency of DPCM transmitting a differencebetween neighboring sample values may be better than the compressionmethod according to frequency-time domain transform and quantization. Inparticular, in a case of a directional intra mode of referencing areference sample in a particular direction, it is highly probable that asample value of a residual sample located adjacent to the referencesample is small whereas a sample value of a residual signal locateddistant from the reference sample is large. Therefore, when directionsapplied to the directional intra mode and DPCM are equal, compressionefficiency of DPCM may be better than frequency-time domain transform.

DPCM is divided according to a relative location of a neighboring sampleto be referred to for a current sample. For example, in vertical DPCM, adifference between sample values of a current sample and a samplelocated in a vertical direction with respect to the current sample isused. Also, in horizontal DPCM, a difference between sample values of acurrent sample and a sample located in a horizontal direction withrespect to the current sample is used. In general, when a predictionblock corresponding to a residual block has been predicted according toa vertical mode, vertical DPCM may be applied to the residual block.Equally, when a prediction block corresponding to a residual block hasbeen predicted according to a horizontal mode, horizontal DPCM may beapplied to the residual block.

In horizontal DPCM, according to whether a right block and a left blockof a current prediction block have been decoded prior to the currentprediction block, a neighboring sample of a current sample which is tobe used in transforming the current sample is determined. When the leftblock of the current prediction block has been decoded prior to thecurrent prediction block, the current sample is transformed according toa difference between sample values of the current sample and a leftsample of the current sample. On the other hand, when the right block ofthe current prediction block has been decoded prior to the currentprediction block, the current sample is transformed according to adifference between sample values of the current sample and a rightsample of the current sample.

FIG. 24A illustrates a method of applying DPCM on a current residualblock 2400, when a left block of a current prediction block, the leftblock corresponding to the current residual block 2400, has been decodedprior to the current prediction block.

Samples of the current residual block 2400 are transformed according tohorizontal DPCM. In FIG. 24A, because the left block of the currentprediction block has been decoded prior to the current prediction block,residual samples of the current residual block 2400 are respectivelytransformed based on residual samples located in the left. In detail, anew sample value of each residual sample is determined based on adifference between a sample value of a certain residual sample and asample value of a residual sample located to the directly left of thecertain residual sample.

For example, a residual sample 2404 is transformed according to adifference between sample values of the residual sample 2404 and aresidual sample 2402. In detail, a new sample value of the residualsample 2404 is determined to be a difference between the sample valuesof the residual sample 2404 and the residual sample 2402. When thesample value of the residual sample 2402 is 1 and the sample value ofthe residual sample 2404 is 2, the new sample value of the residualsample 2404 is determined to be 1 that is the difference between thesample values of the residual sample 2404 and the residual sample 2402.

Equally, a residual sample 2406 is transformed according to a differencebetween sample values of the residual sample 2406 and the residualsample 2404. Also, remaining residual samples of the current residualblock 2400 are transformed in a same manner with respect to the residualsamples 2404 and 2406.

FIG. 24B illustrates a method of applying DPCM on a current residualblock 2450, when a right block of a current prediction block, the rightblock corresponding to the current residual block 2450, has been decodedprior to the current prediction block.

In FIG. 24B, because the right block of the current prediction block hasbeen decoded prior to the current prediction block, residual samples ofthe current residual block 2450 are respectively transformed based onresidual samples located in the right. In detail, a new sample value ofeach residual sample is determined based on a difference between asample value of a certain residual sample and a sample value of aresidual sample located to the directly right of the certain residualsample.

For example, a residual sample 2454 is transformed according to adifference between sample values of the residual sample 2454 and aresidual sample 2452. In detail, a new sample value of the residualsample 2454 is determined to be a difference between the sample valuesof the residual sample 2454 and the residual sample 2452. When thesample value of the residual sample 2452 is 1 and the sample value ofthe residual sample 2454 is 2, the new sample value of the residualsample 2454 is determined to be 1 that is the difference between thesample values of the residual sample 2454 and the residual sample 2452.

Equally, a residual sample 2456 is transformed according to a differencebetween sample values of the residual sample 2456 and the residualsample 2454. Also, remaining residual samples of the current residualblock 2450 are transformed in a same manner with respect to the residualsamples 2454 and 2456.

When both the right block and the left block of the current predictionblock have been decoded, a direction in which horizontal DPCM is to beapplied to the current prediction block may be determined according towhether a directional intra prediction mode applied to the currentprediction block is a leftward horizontal mode or a rightward horizontalmode.

FIG. 25 illustrates a range of neighboring samples necessary todetermine an illumination coefficient with respect to illuminationcompensation. The illumination compensation indicates that illuminationmismatch between different viewpoints is corrected in a multi-viewvideo. When a dependent viewpoint image is encoded or decoded, theillumination compensation is performed by referring to illuminationinformation of an independent viewpoint image to be referred to for thedependent viewpoint image.

For the illumination compensation, neighboring samples of a currentblock of the dependent viewpoint image are compared with neighboringsamples of a reference block of the independent viewpoint image. As aresult of comparing the neighboring samples of the current block withthe neighboring samples of the reference block, a compensationcoefficient and compensation offsets for the illumination compensationbetween the current block and the reference block are calculated. Then,a prediction value of the current block is changed according to thecompensation coefficient and the compensation offsets for theillumination compensation.

FIG. 25 illustrates a current block 2500 and a reference block 2510.Neighboring samples 2502 of the current block 2500 are located in theleft, right, and upper directions of the current block 2500. Equally,neighboring samples 2512 of the reference block 2510 are located in theleft, right, and upper directions of the reference block 2510.

Relative locations of the neighboring samples 2502 of the current block2500 and the neighboring samples 2512 of the reference block 2510 areequal. For example, a neighboring sample 2504 located in the lower rightof the current block 2500 corresponds to a neighboring sample 2514 ofthe reference block 2510. Therefore, the neighboring sample 2504 of thecurrent block 2500 is compared with the neighboring sample 2514 of thereference block 2510. Equally, other neighboring samples of the currentblock 2500 correspond to other neighboring samples of the referenceblock 2510 according to relative locations.

In a case where a left block of the current block 2500 has been decodedprior to the current block 2500, a result of comparing neighboringsamples 2506 located in the left of the current block 2500 withneighboring samples 2516 located in the left of the reference block 2510may be used in calculating a compensation coefficient and compensationoffsets for illumination compensation. Equally, in a case where a rightblock of the current block 2500 has been decoded prior to the currentblock 2500, a result of comparing neighboring samples 2508 located inthe right of the current block 2500 with neighboring samples 2518located in the right of the reference block 2510 may be used incalculating the compensation coefficient and compensation offsets forthe illumination compensation.

Therefore, according to whether neighboring blocks of the current block2500 have been decoded, a range of neighboring samples to be used in theillumination compensation with respect to the current block 2500 isdetermined.

FIGS. 26A to 26C illustrate a method of predicting a current blockaccording to a position dependent intra prediction combination (PDPC)mode. In the PDPC mode, at least two reference samples required inpredicting a current sample are determined according to a location ofthe current sample. A prediction value of the current sample isdetermined to be a weighted average value of sample values of the atleast two reference samples. Weights to be used in determining theweighted average value are determined according to distances between thecurrent sample and the at least two reference samples.

FIG. 26A illustrates a method of predicting a current block according toa PDPC mode, when only left and upper reference samples of a currentblock 2600 are available. A prediction value of a sample 2602 isdetermined to be a weighted average value of sample values of a leftreference sample 2604 and an upper reference sample 2606 of the sample2602. Weights to be applied to the left reference sample 2604 and theupper reference sample 2606 are respectively determined according to adistance between the sample 2602 and the left reference sample 2604 anda distance between the sample 2602 and the upper reference sample 2606.

For example, the weight to be applied to the left reference sample 2604may be determined in proportion to the distance between the sample 2602and the upper reference sample 2606. The weight to be applied to theupper reference sample 2606 may be determined in proportion to thedistance between the sample 2602 and the left reference sample 2604.Therefore, the weight to be applied to the left reference sample 2604may be determined to be 2, and the weight to be applied to the upperreference sample 2606 may be determined to be 3. When the sample valueof the left reference sample 2604 is 130, and the sample value of theupper reference sample 2606 is 80, the prediction value of the sample2602 is determined to be 100 that is a weighted average according to theweights ((130×2+80×3)/(2+3)=100).

Residual samples of the current block 2600 are also predicted in a samemanner to the sample 2602.

FIG. 26B illustrates a method of predicting a current block according toa PDPC mode, when only right and upper reference samples of a currentblock 2620 are available. A prediction value of a sample 2622 isdetermined to be a weighted average value of sample values of a rightreference sample 2624 and an upper reference sample 2626 of the sample2622. Weights to be applied to the right reference sample 2624 and theupper reference sample 2626 are respectively determined according to adistance between the sample 2622 and the right reference sample 2624 anda distance between the sample 2622 and the upper reference sample 2626.Therefore, the left reference sample 2604 of FIG. 26A corresponds to theright reference sample 2624 of FIG. 26B.

For example, the weight to be applied to the right reference sample 2624may be determined in proportion to the distance between the sample 2622and the upper reference sample 2626. Also, the weight to be applied tothe upper reference sample 2626 may be determined in proportion to thedistance between the sample 2622 and the right reference sample 2624.Residual samples of the current block 2620 are also predicted in a samemanner to the sample 2622.

FIG. 26C illustrates a method of predicting a current block according toa PDPC mode, when left, right and upper reference samples of a currentblock 2640 are all available. A prediction value of a sample 2642 isdetermined to be a weighted average value of sample values of a leftreference sample 2644, a right reference sample 2646, and an upperreference sample 2648 of the sample 2642. Weights to be applied to theleft reference sample 2644, the right reference sample 2646, and theupper reference sample 2648 are respectively determined according to adistance between the sample 2642 and the left reference sample 2644, adistance between the sample 2642 and the right reference sample 2646,and a distance between the sample 2642 and the upper reference sample2648.

Alternatively, the prediction value of the sample 2642 may be determinedbased on a first weighted average value of the left reference sample2644 and the upper reference sample 2648 and a second weighted averagevalue of the right reference sample 2646 and the upper reference sample2648, the first weighted average value being obtained in a manner ofFIG. 26A and the second weighted average value being obtained in amanner of FIG. 26B. For example, an average value of the first weightedaverage value and the second weighted average value may be determined tobe the prediction value of the sample 2642. As another example, aweighted average value of the first weighted average value and thesecond weighted average value may be determined to be the predictionvalue of the sample 2642, based on a weight according to a location ofthe sample 2642.

The decoder 1640 may predict a current block according to a predictionmethod determined by the prediction method determiner 1630, and maydecode the current block, based on a result of the prediction withrespect to the current block.

When split information indicates that the current block is not to besplit, the decoder 1640 may obtain, from a bitstream, a final block flagindicating whether the current block is a last block of an encoding treeblock including the current block.

When the final block flag indicates that the current block is the lastblock of the encoding tree block, the decoder 1640 may end decoding ofthe encoding tree block after the current block is decoded. After thecurrent block is decoded, a next encoding tree block may be decoded bythe video decoding device 1600. As in the encoding tree block includingthe current block, the block splitter 1610, the encoding orderdeterminer 1620, the prediction method determiner 1630, and the blockdecoder 1640 that are included in the video decoding device 1600 mayperform split of a block, determination of an encoding order, anddecoding of a final split block on the next encoding tree block.

Also, the decoder 1640 may not obtain the final block flag from thebitstream but may determine whether other blocks except for the currentblock from among blocks included in the encoding tree block have beendecoded, and then may determine whether the current block is the lastblock of the encoding tree block.

The decoder 1640 may entropy decode a syntax element according to acontext of a neighboring block, the syntax element being obtained fromthe bitstream. For example, a skip flag indicating whether the currentblock has been encoded according to a skip mode may be entropy encodedaccording to a context of neighboring blocks of the current block.Therefore, the skip flag may be entropy encoded by referring to acontext with respect to whether a right block of the current block hasbeen decoded. Therefore, the syntax element to be entropy encoded withthe skip flag according to the context of the neighboring blocks of thecurrent block may be entropy encoded by referring to whether the rightblock of the current block has been decoded.

According to Equation 3 below, a method of determining contextinformation uiCtx indicating how many neighboring blocks of the currentblock have been decoded according to the skip mode will now bedescribed. First, an initial value of uiCtx is determined according towhether a left block of the current block has been decoded according tothe skip mode. When the left block of the current block has not beendecoded according to the skip mode, uiCtx is determined to be 0. On theother hand, when the left block of the current block has been decodedaccording to the skip mode, uiCtx is determined to be 1. When an upperblock of the current block has been decoded according to the skip mode,uiCtx is increased by 1. Also, when the right block of the current blockhas been decoded according to the skip mode, uiCtx is increased by 1.Therefore, uiCtx may indicate a value from among 0 to 3. According to anembodiment, a maximum value of uiCtx may be limited to 2.

uiCtx=left is skip 1:0

uiCtx+=above is skip?1:0

uiCtx+=right is skip?1:0

uiCtx or min(uiCtx,2)  [Equation 3]

The skip flag is entropy decoded according to context-based probabilityinformation indicated by uiCtx determined according to Equation 3.

The decoder 1640 may entropy decode split information and split shapeinformation obtained from a bitstream, according to the context of theneighboring blocks. The split information indicates whether the currentblock is to be split, and the split shape information indicates to whichshape the current block is to be split. The split information may beentropy decoded according to whether the neighboring blocks of thecurrent block, the neighboring blocks including the left block, theupper block, and the right block, have been split, and the split shapeinformation may be entropy decoded according to which shape theneighboring blocks of the current block, the neighboring blocksincluding the left block, the upper block, and the right block, havebeen split.

According to Equation 4 below, a method of determining contextinformation uiCtx indicating how many neighboring blocks of the currentblock have been split will now be described. First, an initial value ofuiCtx is determined according to whether the left block of the currentblock has been split. When the left block of the current block has notbeen split, uiCtx is determined to be 0. On the other hand, when theleft block of the current block has been split, uiCtx is determined tobe 1. When the upper block of the current block has been split, uiCtx isincreased by 1. Also, when the right block of the current block has beensplit, uiCtx is increased by 1. Therefore, uiCtx may indicate a valuefrom among 0 to 3. According to an embodiment, a maximum value of uiCtxmay be limited to 2.

uiCtx=left_Depth>curr_Depth?1:0

uiCtx+=above_Depth>curr_Depth?1:0

uiCtx+=right_Depth>curr_Depth?1:0

uiCtx or min(uiCtx,2)  [Equation 4]

The split information is entropy decoded according to context-basedprobability information indicated by uiCtx determined according toEquation 4.

The decoder 1640 may entropy decode FRUC merge information and FRUCmotion prediction information obtained from a bitstream, according tothe context of the neighboring blocks. The FRUC merge informationindicates whether the current block is to be predicted according to aFRUC merge mode, and the FRUC motion prediction information indicateswhether the current block is to be predicted according to a FRUC motionprediction mode. The FRUC merge information may be entropy decodedaccording to whether the neighboring blocks of the current block, theneighboring blocks including the left block, the upper block, and theright block, have been predicted according to the FRUC merge mode, andthe FRUC motion prediction information may be entropy decoded accordingto whether the neighboring blocks of the current block, the neighboringblocks including the left block, the upper block, and the right block,have been predicted according to the FRUC motion prediction mode.

According to Equation 5 below, a method of determining contextinformation uiCtx indicating how many neighboring blocks of the currentblock have been decoded according to the FRUC merge mode will now bedescribed. First, an initial value of uiCtx is determined according towhether the left block of the current block has been decoded accordingto the FRUC merge mode. When the left block of the current block has notbeen decoded according to the FRUC merge mode, uiCtx is determined to be0. On the other hand, when the left block of the current block has beendecoded according to the FRUC merge mode, uiCtx is determined to be 1.When the upper block of the current block has been decoded according tothe FRUC merge mode, uiCtx is increased by 1. Also, when the right blockof the current block has been decoded according to the FRUC merge mode,uiCtx is increased by 1. Therefore, uiCtx may indicate a value fromamong 0 to 3. According to an embodiment, a maximum value of uiCtx maybe limited to 2.

uiCtx=left is FRUCmergeMode?1:0

uiCtx+=above is FRUCmergeMode?1:0

uiCtx+=right is FRUCmergeMode?1:0

uiCtx or min(uiCtx,2)  [Equation 5]

The FRUC merge information is entropy decoded according to context-basedprobability information indicated by uiCtx determined according toEquation 5.

According to Equation 6 below, a method of determining contextinformation uiCtx indicating how many neighboring blocks of the currentblock have been decoded according to the FRUC motion prediction modewill now be described. First, an initial value of uiCtx is determinedaccording to whether the left block of the current block has beendecoded according to the FRUC motion prediction mode. When the leftblock of the current block has not been decoded according to the FRUCmotion prediction mode, uiCtx is determined to be 0. On the other hand,when the left block of the current block has been decoded according tothe FRUC motion prediction mode, uiCtx is determined to be 1. When theupper block of the current block has been decoded according to the FRUCmotion prediction mode, uiCtx is increased by 1. Also, when the rightblock of the current block has been decoded according to the FRUC motionprediction mode, uiCtx is increased by 1. Therefore, uiCtx may indicatea value from among 0 to 3. According to an embodiment, a maximum valueof uiCtx may be limited to 2.

uiCtx=left FRUCmergeMode==FRUC_MERGE_BILATERALMV?1:0

uiCtx+=above FRUCmergeMode==FRUC_MERGE_BILATERALMV?1:0

uiCtx+=right FRUCmergeMode==FRUC_MERGE_BILATERALMV?1:0

uiCtx or min(uiCtx,2)  [Equation 6]

The FRUC motion prediction information is entropy decoded according tocontext-based probability information indicated by uiCtx determinedaccording to Equation 6.

The decoder 1640 may entropy decode affine mode information obtainedfrom a bitstream, according to the context of the neighboring blocks.The affine mode information may be entropy decoded according to whetherthe neighboring blocks of the current block, the neighboring blocksincluding the left block, the upper block, and the right block, havebeen predicted according to an affine mode.

According to Equation 7 below, a method of determining contextinformation uiCtx indicating how many neighboring blocks of the currentblock have been decoded according to the affine mode will now bedescribed. First, an initial value of uiCtx is determined according towhether the left block of the current block has been decoded accordingto the affine mode. When the left block of the current block has notbeen decoded according to the affine mode, uiCtx is determined to be 0.On the other hand, when the left block of the current block has beendecoded according to the affine mode, uiCtx is determined to be 1. Whenthe upper block of the current block has been decoded according to theaffine mode, uiCtx is increased by 1. Also, when the right block of thecurrent block has been decoded according to the affine mode, uiCtx isincreased by 1. Therefore, uiCtx may indicate a value from among 0 to 3.According to an embodiment, a maximum value of uiCtx may be limited to2.

uiCtx=left is Affine?1:0

uiCtx+=above is Affine?1:0

uiCtx+=right is Affine?1:0

uiCtx or min(uiCtx,2)  [Equation 7]

The affine mode information is entropy decoded according tocontext-based probability information indicated by uiCtx determinedaccording to Equation 7.

The decoder 1640 may entropy decode motion vector resolution informationobtained from a bitstream, according to the context of the neighboringblocks. The motion vector resolution information indicates whether amotion vector resolution of the current block is a default motion vectorresolution. For example, when the motion vector resolution is thedefault motion vector resolution, the motion vector resolutioninformation may indicate 0, and when the motion vector resolution is notthe default motion vector resolution, the motion vector resolutioninformation may indicate 1. The motion vector resolution information maybe entropy decoded according to which motion vector resolution theneighboring blocks of the current block, the neighboring blocksincluding the left block, the upper block, and the right block, havebeen predicted.

According to Equation 8 below, a method of determining contextinformation uiCtx indicating whether the neighboring blocks of thecurrent block have been decoded according to the default motion vectorresolution will now be described. First, an initial value of uiCtx isdetermined according to whether the left block of the current block hasbeen decoded according to the default motion vector resolution. When theleft block of the current block has not been decoded according to thedefault motion vector resolution, uiCtx is determined to be 0. On theother hand, when the left block of the current block has been decodedaccording to the default motion vector resolution, uiCtx is determinedto be 1. When the left block of the current block has not been decodedaccording to the default motion vector resolution, uiCtx is increasedby 1. Also, when the right block of the current block has not beendecoded according to the default motion vector resolution, uiCtx isincreased by 1. Therefore, uiCtx may indicate a value from among 0 to 3.According to an embodiment, a maximum value of uiCtx may be limited to2.

uiCtx=left MVresFlag>0?1:0

uiCtx+=above MVresFlag>0?1:0

uiCtx+=right MVresFlag>0?1:0

uiCtx or min(uiCtx,2)  [Equation 8]

The motion vector resolution information is entropy decoded according tocontext-based probability information indicated by uiCtx determinedaccording to Equation 8.

Therefore, the decoder 1640 may entropy decode syntax elements byreferring to whether the right block of the current block has beendecoded, the syntax elements being entropy decoded according to thecontext of the neighboring block. Equally, other syntax elements thatare not described in the present specification may be entropy decodedbased on the right block of the current block.

The decoder 1640 may inverse quantize and inverse transform residualdata obtained from the bitstream. Then, the decoder 1640 may reconstructthe current block by using the inverse quantized and inverse transformedresidual data and the prediction result about the current block.

FIG. 27 illustrates a video decoding method according to an embodimentinvolving splitting a current block and determining an encoding order ofsplit lower blocks.

In operation 2710, split information indicating whether a current blockis to be split is obtained from a bitstream.

In operation 2720, when the split information indicates that the currentblock is not to be split, the current block is decoded based on encodinginformation about the current block.

When the current block is not split based on the split information butis inter predicted, reference samples to be referred to for the currentblock are determined according to whether a left block and a right blockof the current block have been decoded. Then, the current block ispredicted and decoded based on the reference samples.

When only the left block of the current block has been decoded, samplesadjacent to the current block in left and upper directions are includedin the reference samples. When only the right block of the current blockhas been decoded, samples adjacent to the current block in right andupper directions are included in the reference samples. When both theleft and right blocks of the current block have been decoded, samplesadjacent to the current block in right, left and upper directions areincluded in the reference samples. When both the left and right blocksof the current block have not been decoded, samples adjacent to thecurrent block in an upper direction are included in the referencesamples.

When the current block is not split based on the split information butis intra predicted, a plurality of most-frequent intra prediction modesof the current block may be determined. In a case where the left blockof the current block has been decoded prior to the current block byusing an intra prediction method, a most-frequent intra prediction modeof the current block may be determined by referring to an intraprediction mode of the left block of the current block. Equally, whenthe right block of the current block has been decoded prior to thecurrent block by using the intra prediction method, the most-frequentintra prediction mode of the current block may be determined byreferring to an intra prediction mode of the right block of the currentblock

When the current block is not split based on the split information butis intra predicted, reference samples to be used in intra predictionwith respect to the current block are obtained. When the left block ofthe current block has been decoded prior to the current block, areference sample may be obtained from the left block of the currentblock. Equally, when the right block of the current block has beendecoded prior to the current block, a reference sample may be obtainedfrom the right block of the current block.

When the current block is inter predicted, it is checked whether theright block of the current block has been decoded according to interprediction. When the right block of the current block has been decodedaccording to inter prediction, a motion vector of the current block isdetermined by using a motion vector of the right block.

When the current block is inter predicted according to the merge mode,motion vector candidates are obtained from a right block, a lower-rightblock, an upper block, an upper-left block, a left block, and anupper-right block of the current block. When the current block is interpredicted according to an AMVP mode, a first motion vector candidate isdetermined from the right block or the lower-right block of the currentblock, and a second motion vector candidate is determined from the upperblock, the upper-right block, or the upper-left block of the currentblock.

When the current block is inter predicted according to the AMVP mode,and the right block of the current block has been decoded prior to thecurrent block, a first motion vector candidate may be determined fromthe right block or the lower-right block of the current block, and asecond motion vector candidate may be determined from the upper block,the upper-right block, or the upper-left block of the current block.

After prediction is performed on the current block, a transform blockcorresponding to the current block may be determined according to aresult of inverse quantizing and inverse transforming residual data.Then, the current block may be reconstructed according to the inversequantized and inverse transformed residual data of the transform block.

To correct an illumination mismatch between different viewpoints in amulti-view video, prediction values of the current block may beillumination compensated for based on illumination information obtainedfrom neighboring samples of the current block and neighboring samples ofa reference block.

When the left block of the current block has been decoded prior to thecurrent block, the illumination information is obtained fromleft-neighboring samples of the current block and left-neighboringsamples of the reference block. When the right block of the currentblock has been decoded prior to the current block, the illuminationinformation is obtained from right-neighboring samples of the currentblock and right-neighboring samples of the reference block.

When the current block is intra predicted according to a location-basedintra prediction mode, a current sample included in the current block ispredicted according to a vertical location and a vertical referencesample and a horizontal location and a horizontal reference sample ofthe current sample.

When the left block of the current block has been decoded prior to thecurrent block, the horizontal reference sample is located at acrosspoint of a row where the current sample is located and a columnadjacent to the current block in a left direction, and the horizontallocation is determined based on a distance between the current sampleand the horizontal reference sample.

Equally, when the right block of the current block has been decodedprior to the current block, the horizontal reference sample is locatedat a crosspoint of a row where the current sample is located and acolumn adjacent to the current block in a right direction, and thehorizontal location is determined based on a distance between thecurrent sample and the horizontal reference sample.

In a case where the current block is intra predicted, the left block ofthe current block has not been decoded prior to the current block, andthe right block of the current block has been decoded prior to thecurrent block, inverse quantized and inverse transformed residual datamay be left-right flipped and thus may be used in reconstructing thecurrent block.

When the transform block is determined according to a DPCM mode,residual data is not inverse transformed according to frequency-timedomain transform but is inverse transformed according to the DPCM mode.According to the DPCM mode, a residual value of the current sample ofthe transform block is re-calculated based on a neighboring sample fromamong the neighboring samples of the current sample. Then, the transformblock is determined based on the re-calculated residual value of thecurrent sample.

When the transform block is determined according to a horizontal DPCMmode, it is determined, according to whether the neighboring blocks ofthe current block have been decoded, which neighboring sample is used inre-calculating a residual value of the current sample. When the leftblock of the current block has been decoded prior to the current block,a left sample of the current sample is determined as a neighboringsample to be used in re-calculation. Equally, when the right block ofthe current block has been decoded prior to the current block, a rightsample of the current sample is determined as a neighboring sample to beused in the re-calculation.

In operation 2730, when the split information indicates that the currentblock is to be split, the current block is split into at least two lowerblocks, encoding order information indicating an encoding order of thelower blocks of the current block is obtained from the bitstream, adecoding order of the lower blocks is determined based on the encodingorder information, and the lower blocks are decoded according to thedecoding order.

In operations 2710 to 2730, a plurality of pieces of informationobtained from the bitstream are entropy decoded and thus are used indecoding an image. When the left block of the current block has beendecoded prior to the current block, entropy decoding with respect to theinformation may be performed based on context information of the leftblock of the current block. Equally, when the right block of the currentblock has been decoded prior to the current block, entropy decoding withrespect to the information may be performed based on context informationof the right block of the current block.

Functions of the video decoding device 1600 which are described withreference to FIG. 16 may be included in the video decoding method 2700.

FIG. 28 illustrates a video encoding device 2800 according to anembodiment involving splitting a current block and determining anencoding order of split lower blocks.

The video encoding device 2800 includes an encoding informationgenerator 2810 and an output unit 2820. In FIG. 28, the encodinginformation generator 2810 and the output unit 2820 are illustrated asseparate configuring units, but in another embodiment, the encodinginformation generator 2810 and the output unit 2820 may be combined tobe implemented as one configuring unit.

In FIG. 28, the encoding information generator 2810 and the output unit2820 are illustrated as configuring units included in one device, butdevices performing respective functions of the encoding informationgenerator 2810 and the output unit 2820 are not required to bephysically adjacent to each other. Therefore, in another embodiment, theencoding information generator 2810 and the output unit 2820 may bedispersed.

The encoding information generator 2810 and the output unit 2820 may beimplemented by one processor according to an embodiment. Alternatively,they may be implemented by a plurality of processors according toanother embodiment.

Functions performed by the encoding information generator 2810 and theoutput unit 2820 of FIG. 32 may be performed by the output unit 130 ofFIG. 1A.

The encoding information generator 2810 may split a current block intoat least two lower blocks, and according to a result of the split of thecurrent block, may determine whether to split the current block. Forexample, when coding efficiency by splitting the current block is good,the encoding information generator 2810 may determine to split thecurrent block, and when coding efficiency by not splitting the currentblock is good, the encoding information generator 2810 may determine notto split the current block.

The encoding information generator 2810 may generate split informationindicating whether the current block is to be split. Then, the encodinginformation generator 2810 may determine a split method for the currentblock according to the coding efficiency, and may generate split shapeinformation indicating the split method for the current block.

The encoding information generator 2810 may determine an encoding orderof lower blocks included in the current block, based on codingefficiency according to the encoding order, and may generate encodingorder information indicating the encoding order of the lower blocks.

When the current block is not to be further encoded, the encodinginformation generator 2810 may determine a prediction mode with respectto the current block. The encoding information generator 2810 maydetermine the prediction mode with respect to the current block,according to coding efficiencies of prediction modes that are applicableto the current block. The prediction modes that are applicable to thecurrent block may include a directional mode, a DC mode, a planar mode,a MPI mode, an LM chroma mode, an MPC mode, a merge mode, an AMVP mode,an OBMC mode, a sub-block MVP mode, an affine merge mode, an affine AMVPmode, a bilateral matching FRUC mode, a template matching FRUC mode, aPDPC mode, or the like.

The output unit 2820 outputs a bitstream including encoding informationabout the current block, the encoding information being generated by theencoding information generator 2810. The encoding information about thecurrent block may include split information, split shape information,split order information, prediction mode information, or the like.

The video encoding device 2800 of FIG. 28 may perform a video encodingmethod corresponding to the video decoding method 2700 performed by thevideo decoding device 1600 of FIG. 16.

FIG. 29 illustrates a video encoding method according to an embodimentinvolving splitting a current block and determining an encoding order ofsplit lower blocks.

In operation 2910, a current block is split into at least two lowerblocks.

In operation 2920, according to a result of splitting the current block,whether to split the current block is determined, and split informationindicating whether to split the current block is generated.

In operation 2930, according to coding efficiency of the current block,an encoding order of the lower blocks of the current block isdetermined, and encoding order information indicating the encoding orderof the lower blocks is generated.

In operation 2940, a bitstream including split information and theencoding order information is output.

Functions of the video encoding device 2800 which are described withreference to FIG. 28 may be included in the video encoding method.

According to the video encoding technique based on coding units having atree structure which is described with reference to FIGS. 1 to 29, imagedata of a spatial domain is encoded in each of the coding units having atree structure, and decoding is performed on each largest coding unitaccording to the video decoding technique based on coding units having atree structure so that the image data of the spatial domain isreconstructed, and by doing so, a picture and a video that is a picturesequence may be reconstructed. The reconstructed video may be reproducedby a reproducing apparatus, may be stored in a storage medium, or may betransmitted through a network.

The embodiments according to the present disclosure may be written ascomputer programs and may be implemented in a general-use digitalcomputer that executes the programs by using a computer-readablerecording medium.

While the best embodiments of the present disclosure have beendescribed, it will be understood by one of ordinary skill in the artthat various replacements, modifications, or changes with respect to thepresent disclosure may be made therein without departing from the spiritand scope as defined by the following claims. That is, the claims willbe construed as including the various replacements, modifications, orchanges with respect to the present disclosure. Therefore, thedescriptions provided in the specification and drawings should beconsidered in a descriptive sense only and not for purposes oflimitation.

1. A video decoding method comprising: obtaining, from a bitstream,split information indicating whether a current coding unit is to besplit into at least two lower coding units; when the split informationindicates that the current coding unit is not to be split into the atleast two lower coding units, decoding the current coding unit based onencoding information about the current coding unit; when the splitinformation indicates that the current coding unit is to be split intothe at least two lower coding units, splitting the current coding unitinto the at least two lower coding units, obtaining, from the bitstream,encoding order information indicating a decoding order of the at leasttwo lower coding units, including horizontally neighboring lower codingunits, of the current coding unit, determining whether the decodingorder of the at least two lower coding units is a first order from aleft lower coding unit to a right lower coding unit, among thehorizontally neighboring lower coding units, or a second order from theright lower coding unit to the left lower coding unit, based on theencoding order information; and decoding the horizontally neighboringlower coding units according to the first order or the second order,characterized in that the decoding the horizontally neighboring lowercoding units according to the first order or the second order comprises:when the right lower coding unit is intra-predicted prior to the leftlower coding unit, among the horizontally neighboring lower codingunits, according to the second order, determining an intra predictionmode of the right lower coding unit; determining a most probable mode(MPM) list of the left lower coding unit by using the intra predictionmode of the right lower coding unit; and performing intra-prediction onthe left lower coding unit by using an intra prediction mode selectedfrom the MPM list.
 2. A video decoding device comprising: a blocksplitter configured to obtain, from a bitstream, split informationindicating whether a current coding unit is to be split into at leasttwo lower coding units, and split the current coding unit into the atleast two lower coding units when the split information indicates thatthe current coding unit is to be split into the at least two lowercoding units; an encoding order determiner configured to, when thecurrent coding unit is split into the at least two lower coding units,obtain, from the bitstream, encoding order information indicating adecoding order of the at least two lower coding units, includinghorizontally neighboring lower coding units, of the current coding unit,and determine whether the decoding order of the at least two lowercoding units is a first order from a left lower coding unit to a rightlower coding unit, among the horizontally neighboring lower codingunits, or a second order from the right lower coding unit to the leftlower coding unit, based on the encoding order information; a predictionmethod determiner configured to determine an affine mode on the leftlower coding unit; and a decoder configured to perform inter predictionin the affine mode on the left lower coding unit, characterized in that:when the right lower coding unit is intra-predicted prior to the leftlower coding unit, among the horizontally neighboring lower codingunits, according to the second order, the prediction method determinerdetermines an intra prediction mode of the right lower coding unit, anddetermines a most probable mode (MPM) list of the left lower coding unitby using the intra prediction mode of the right lower coding unit, andthe decoder performs intra-prediction on the left lower coding unit byusing an intra prediction mode selected from the MPM list.
 3. A videoencoding method comprising: splitting a current coding unit into atleast two lower coding units; generating split information indicatingwhether the current coding unit is to be split into the at least twolower coding units; determining an encoding order of horizontallyneighboring lower coding units, among the at least two lower codingunits, of the current coding unit, and generating encoding orderinformation indicating whether the encoding order of the horizontallyneighboring lower coding units is a first order from a left lower codingunit to a right lower coding unit, among the horizontally neighboringlower coding units, or a second order from the right lower coding unitto the left lower coding unit; and outputting a bitstream comprising thesplit information and the encoding order information, characterized inthat the generating of the encoding order information comprises: whenthe right lower coding unit is intra-predicted prior to the left lowercoding unit, among the horizontally neighboring lower coding units,according to the second order, determining an intra prediction mode ofthe right lower coding unit; determining a most probable mode (MPM) listof the left lower coding unit by using the intra prediction mode of theright lower coding unit; and performing intra-prediction on the leftlower coding unit by using an intra prediction mode selected from theMPM list.